[Csync2] cpu usage csync2 high

Lars Ellenberg lars.ellenberg at linbit.com
Tue Nov 9 22:11:50 CET 2010


On Tue, Nov 09, 2010 at 12:47:34PM -0800, B T wrote:
> this scrip runs on startup...However I killed the inotifywait process....yet csync2 keep starting itself and inotify is not running.  is it part of xinetd i don't think that makes it starup.    
> 
> cat notifyscript.sh 
> #!/bin/bash
> inotifywait -mrq --format %f -e close_write -e create -e delete -e move -e modify /etc /var/www /var/log/apache2 | while read file; do /usr/sbin/csync2 -x >/dev/null 2>&1; done
> #/usr/sbin/csync2 -x >/dev/null 2>&1;

You start a full csync2 check run for every inotify event
Don't do that.
You hopefully meant to only check only the possibly changed file,
which also is not the best way to do it (hint: use the hint table).

There may be a lot of such lines queued up, and if the shell loop is
still running, it may have a pipe buffer full to still read in and
process.

Double check with ps in tree mode (use your favorite options)
that there really is nothing running anymore that may start csync2 for
every log line...
check on all nodes to be sure.
check cron.

then, start using csync2 sensibly ;-)

-- 
: 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