[Csync2] speed of "-cr /"
Lars Ellenberg
lars.ellenberg at linbit.com
Thu Jun 10 10:02:27 CEST 2010
On Thu, Jun 10, 2010 at 09:48:11AM +1000, Aristedes Maniatis wrote:
> On 9/06/10 9:41 PM, Lars Ellenberg wrote:
> >On Wed, Jun 09, 2010 at 08:12:52PM +1000, Aristedes Maniatis wrote:
> >>On 8/06/10 12:02 AM, Lars Ellenberg wrote:
> >>>csync2 -cr /
> >>>does exactly that:
> >>>it looks at its database, and stats all files listed in that database,
> >>>as well as directories, and compares the recorded stat info with the
> >>>"live" stat info.
>
> Certainly as you say -vvvv gives lots of useful information about what
> is going on, which helps fills in the gaps in the documentation. It is
> clear that having a command line path of "/" causes every record to be
> fetched from the database:
>
> Trying to fetch a row from the database.
>
> In my case, this is just under 100,000 of those log entries and that
> takes 99% of the time for the entire command to run. It looks like
> every record is fetched from the database, rather than just the
> records in the 'include' paths. Perhaps it is just too difficult to
> construct the SQL select command out of an arbitrary number of
> include/exclude statements.
>
> But oddly, when I use "-R" csync2 presumably also fetches the entire
> db, but this time executes in a tiny fraction of the time (5 seconds,
> compared to over a minute for '-cr'). There are the same number of
> "Trying to fetch a row from the database." lines in the output.
For -R, its just config parsing, and SQL.
For -c, it is one lstat for every record fetched.
100000 lstat calls may take some time ;-)
--
: Lars Ellenberg
: LINBIT | Your Way to High Availability
: DRBD/HA support and consulting http://www.linbit.com
DRBD® and LINBIT® are registered trademarks of LINBIT, Austria.
More information about the Csync2
mailing list