Thanks so much for the info. It does appears as though rsync scans the entire subdir before doing anything, which seems pretty inefficient, perhaps this will be improved in a future release. Although, maybe it has to be this way, so that the --delete commands can work?<br>
<br><div class="gmail_quote">On Thu, Jul 26, 2012 at 4:42 PM, Lars Ellenberg <span dir="ltr"><<a href="mailto:lars.ellenberg@linbit.com" target="_blank">lars.ellenberg@linbit.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Thu, Jul 19, 2012 at 01:51:43PM -0400, Cary Lewis wrote:<br>
> I want to use rsync with a cloud based rsync provider to do off-site<br>
> backing up of a large (1TB) dataset which consists of 32 million+ files<br>
> spread out in 300 directories. So the amount of files in any one directory<br>
> can be quite large (upwards of 2 million).<br>
<br>
</div>You realize that stat() is a costly operation,<br>
especially if the inodes are cache cold, even more so if something else<br>
stresses the IO and VM subsystems on the box.<br>
<br>
On a moderately loaded box, recursively stating 3 million files<br>
occasionally took 90 minutes and more.  Doing the same once the inodes<br>
are cache-hot takes the same box under the same overall stress 30 to 90<br>
*seconds*.<br>
<br>
Holding 3 Millon dentries and inodes cache-hot requires (on that box,<br>
anyways) ~ 5 Gigabyte of slab memory (of 128 G available...).<br>
<br>
So if you want to regularly recursively stat (and that's what rsync<br>
needs to do) 32 millon files, you better add more ram, much more ram,<br>
to your box.<br>
<br>
Also, you mention Cygwin.<br>
IIRC, by default, that will still treat file names as case*in*sensitive,<br>
so you get really bad (maybe O N^2?) behaviour<br>
when walking large directories.<br>
<br>
There was some setting which I do not remember right now,<br>
to tell rsync and/or cygwin to treat this as casesensitive,<br>
which can seriously improve behaviour with large directories.<br>
<div class="im"><br>
> Rsync doesn't seem to cope with this well - even doing local copies in a<br>
> directory with several thousands of files takes a long time to initiate any<br>
> transferring.<br>
<br>
</div>I'm speculating here.<br>
But I thought the file list generation is still per sub-directory, so<br>
would need to scan the current subdir fully before starting to work on<br>
the resulting partial file list.<br>
<div class="im HOEnZb"><br>
> I though that with version 3, rsync was supposed to start transferring<br>
> before fully testing all of the files in a directory?<br>
><br>
> I am using version 3.0.9 under Cygwin.<br>
><br>
> Is there a command line switch I am supposed to use to force rsync to start<br>
> transferring more quickly?<br>
><br>
> Any insight / suggestions would be most appreciated.<br>
<br>
<br>
</div><span class="HOEnZb"><font color="#888888">--<br>
: Lars Ellenberg<br>
: LINBIT | Your Way to High Availability<br>
: DRBD/HA support and consulting <a href="http://www.linbit.com" target="_blank">http://www.linbit.com</a><br>
</font></span><div class="HOEnZb"><div class="h5">--<br>
Please use reply-all for most replies to avoid omitting the mailing list.<br>
To unsubscribe or change options: <a href="https://lists.samba.org/mailman/listinfo/rsync" target="_blank">https://lists.samba.org/mailman/listinfo/rsync</a><br>
Before posting, read: <a href="http://www.catb.org/~esr/faqs/smart-questions.html" target="_blank">http://www.catb.org/~esr/faqs/smart-questions.html</a><br>
</div></div></blockquote></div><br>