<div dir="ltr"><div class="gmail_quote"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="">On 14 November 2016 at 05:10, Shyam <span dir="ltr">&lt;<a href="mailto:srangana@redhat.com" target="_blank">srangana@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span>On 11/11/2016 05:46 AM, Susant Palai wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello All,<br>
   We have been receiving many requests from users to give a &quot;Rebalance  completion time estimation&quot;. This email is to gather ideas and feedback from the community for the same. We have one proposal, but nothing is concrete. Please feel free to give your input for this problem.<br>
<br>
A brief about rebalance operation:<br>
- Rebalance process is used to rebalance data across cluster most likely in the event of add-brick and remove-brick. Rebalance is spawned on each node. The job for the process is to read directories, fix it&#39;s layout to include the newly added brick. Read children files(only those reside on local bricks) of the directory and migrate them if necessary decided by the new layout.<br>
<br>
<br>
Here is one of the solution pitched by Manoj Pillai.<br>
<br>
Assumptions for this idea:<br>
 - files are of similar size.<br>
 - Max 40% of the total files will be migrated<br>
<br>
1- Do a statfs on the local bricks. Say the total size is St.<br>
</blockquote>
<br></span>
Why not use the f_files from statfs that shows inode count and use that and possibly f_ffree, to determine how many inodes are there, and then use the crawl, to figure out how many we have visited and how many are pending to determine rebalance progress.<br>
<br>
I am not sure if the local FS (XFS say) fills up this data for use, but if it does, then it may provide a better estimate.<div class="m_-1124187519666395031HOEnZb"><div class="m_-1124187519666395031h5"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br></blockquote></div></div></blockquote></span><div>Thanks Shyam, that is a good idea. </div><div>I tried out  a very rough version of this. The statfs does return the inode info (available and used) on my XFS brick. However those numbers are thrown way off by the entries in the .glusterfs directory.  In my very limited file only dataset, there were almost twice as many inodes in use as there were files in the volume.  I am yet to try out the results with a directory heavy data set.</div><div><br></div><div><br></div><div>High level algorithm:</div><div><br></div><div>1. When rebalance starts up, get the estimated number of files on the brick using the statfs inode count.</div><div>2. As rebalance proceeds, calculate the rate at which files are being looked up. This is based on the assumption that a rebalance cannot complete until the filesystem crawl is complete. Actual file migration operations do not seem to contribute greatly to this time but that still needs to be validated with more realistic data sets.</div><div>3. Using the calculated rate and the estimated number of files, calculate the time it would take to process all the files on the brick.  That would be our estimate for how long rebalance would take to complete on that node.</div><div><br></div><div>Things to be considered/assumptions:</div><div><br></div><div>1. A single filesystem partition contains a single brick in order for the statfs info to be valid</div><div>2. My test was run on a single brick volume to which I added another brick and started rebalance. More nodes and bricks in the cluster would mean that the total number of files might change more frequently as files are not just moved off the brick but to it as well.</div><div><br></div><div>That being said, the initial results are encouraging. The estimates generated were fairly close to the times actually taken. The estimates are generated every time the </div><div>gluster v rebalance &lt;vol&gt; status</div><div><br></div><div>command is run and the values autocorrect to take the latest data into consideration. However, mine was a limited setup and most rebalance runs took around 10 mins or so. It would be interesting to see the numbers for larger data sets where rebalance takes days or weeks.<br></div><div><br></div><div>Regards,</div><div>Nithya</div><span class=""><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-1124187519666395031HOEnZb"><div class="m_-1124187519666395031h5"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
<br>
<br>
<br>
<br>
______________________________<wbr>_________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@gluster.org" target="_blank">Gluster-devel@gluster.org</a><br>
<a href="http://www.gluster.org/mailman/listinfo/gluster-devel" rel="noreferrer" target="_blank">http://www.gluster.org/mailman<wbr>/listinfo/gluster-devel</a><br>
<br>
</blockquote>
______________________________<wbr>_________________<br>
Gluster-devel mailing list<br>
<a href="mailto:Gluster-devel@gluster.org" target="_blank">Gluster-devel@gluster.org</a><br>
<a href="http://www.gluster.org/mailman/listinfo/gluster-devel" rel="noreferrer" target="_blank">http://www.gluster.org/mailman<wbr>/listinfo/gluster-devel</a><br>
</div></div></blockquote></span></div><br></div></div>
</div><br></div>