[Csync2] periodic check of hints table
Clifford Wolf
clifford at clifford.at
Fri Nov 4 12:01:57 CET 2005
Hi,
On Tue, Nov 01, 2005 at 01:46:30PM -0600, Michael Milkovich wrote:
> I'm developing an inotify-based "watcher" daemon (iwatchd?) that
> populates the csync2 hints table.
>
> [...]
>
> I am looking for suggestions on how to run the csync2 side of this. My
> current thought is to have on each machine an inetd-based csync2
> listener, and then periodically run csync2 -c followed csync2 -u. One
> possibility is to just put these two lines into a cron job and run it
> once a minute or so. Another possibility is to add a "delayed repeat"
> function to csync2 -- process all hints, sleep for x seconds, then
> process all hints again. A third possibility is to rig up some kind of
> signal to a daemonized csync2 that says "there are new hints, wake up
> and do something about them".
>
> Suggestions?
I'd suggest to run csync2 periodically. eighter from a cron job or from
your watcher daemon.
The overhead for creating the new csync2 process, parsing the config,
opening the database, etc. seams to be about 0m0.004s on my test server
(dual xeon 2.50GHz). This is 0m0.008s for the "-c" and the "-u" mode
together. Even if you run it once a second this would be only a load
of 0.8%. A combined mode for "-c" and "-u" would further reduce the
overhead.
I'd start csync2 from the watcher daemon and not from cron.
yours,
- clifford
--
#!/usr/bin/perl -F(?#_leetmaker_v1.1_-_by_clifford_wolf_)
$_="Leetmaker v1.1\n";do{y/A-Z/a-z/;s/the/dA/g;s/s\b/z/g;
y/elitosaA/3|1+054a/;s/k/|</g;s/h/|-|/g;s/(^|[^f])f(?!(?#
$)f)/$1ph/g;s/\s*!(!+)/ !1$1/g;s/0u/oo/g;print}while(<>);
"The generation of random numbers is too important to be left to chance."
- Robert R. Coveyou, Oak Ridge National Laboratory.
More information about the Csync2
mailing list