<div dir="ltr"><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><h1 style="white-space:normal"><span style="font-weight:normal"><font size="2" style=""></font></span></h1></pre><pre style="white-space:pre-wrap"><font color="#000000" style="background-color:rgb(255,255,255)" face="arial, sans-serif">Riffing on something Andreas said in a lustre-discuss thread, I'm hoping someone can correct my understanding of how precreate works currently.</font></pre><pre style="white-space:pre-wrap"><font color="#000000" style="background-color:rgb(255,255,255)" face="arial, sans-serif">Olden days: </font></pre><pre style="white-space:pre-wrap"><font color="#000000" style="background-color:rgb(255,255,255)" face="arial, sans-serif">MDS would ask each OST for a set of precreated objects via a MDT->OST RPC. These have to be cleaned up during recovery, hence a cap. These were used up as MDS assigned them to layouts, and so MDS has to go back and get more, even for 0-length files.</font></pre><pre style="white-space:pre-wrap"><font color="#000000" style="background-color:rgb(255,255,255)" face="arial, sans-serif">Modern days, Lustre 2.5+:</font></pre><pre style="white-space:pre-wrap"><span style="box-sizing:inherit;font-variant-ligatures:common-ligatures;white-space:normal;background-color:rgb(255,255,255)"><font color="#000000" style="" face="arial, sans-serif">MDT doesn't hold a pool of OST objects but instead takes an OST fid range from a FLD server instead. Each MD object has a mapping with an eventual OST object by this fid. The OST side just holds a small number of anonymous objects and assigns the fid to an object when any operation is executed without an existing FID->inode mapping on the OST.</font></span><span class="gmail-c-mrkdwn__br" style="box-sizing:inherit;display:block;height:8px;font-variant-ligatures:common-ligatures;white-space:normal"></span><font color="#000000" style="background-color:rgb(255,255,255)" face="arial, sans-serif"><span style="box-sizing:inherit;font-variant-ligatures:common-ligatures;white-space:normal">There is no more precreate RPC necessary, since OSTs maintain their own pool of anonymous objects and only use them up when data is actually written, and can create more when running low. There is no recovery cleanup needed on the OSTs. </span><br style="box-sizing:inherit;font-variant-ligatures:common-ligatures;white-space:normal"><span style="box-sizing:inherit;font-variant-ligatures:common-ligatures;white-space:normal">In this case, there should be no performance difference between create and mknod except for the FLD operation, and the number of OSTs should not matter for create rates.</span></font></pre><pre style=""><font color="#000000" face="arial, sans-serif"><span style="font-variant-ligatures:common-ligatures;white-space:normal">Is my understanding wrong? It clearly must be, since Andreas is still talking OST_CREATE rpc and recovery implications, and we do see a performance difference with mknod and creating files with layouts.<br></span></font><span class="gmail-c-mrkdwn__br" style="white-space:normal;box-sizing:inherit;display:block;height:8px;font-variant-ligatures:common-ligatures"></span><span class="gmail-c-mrkdwn__br" style="white-space:normal;box-sizing:inherit;display:block;height:8px;font-variant-ligatures:common-ligatures"><br></span></pre><pre style="white-space:pre-wrap;color:rgb(0,0,0)"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">[lustre-discuss] Improving file create performance with larger create_count)<span style="font-family:Arial,Helvetica,sans-serif"> </span><span style="font-family:Arial,Helvetica,sans-serif"> </span></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">The max_create_count is between 32 and 20000 (for protocol recovery reasons, since unused precreated objects are destroyed during recovery, and we put a cap on how many objects could be destroyed to avoid badness in case of a bug) so this is already at the maximum.  You should be able to increase the create_count to 20000 as well. However, this value is "auto tuned" based on how long it takes the OSS to create the requested objects.  If the OST_CREATE RPC takes too long then the MDS will ask for fewer objects next time.
* Is there a theoretical down side to pre-creating more objects?  (MDS or OSS memory usage?  Longer mount times? slower e2fsck?)
A bit slower e2fsck, but compared to the total filesystem size this is minor.  The biggest issue is that the old precreated objects will be destroyed during MDS-OSS recovery and new ones created.</blockquote></pre><br class="gmail-Apple-interchange-newline"></div>