Forum: CFEngine Help
Subject: Re: cf-exced ignores splaytime on syntax errors / unleash the stampede
Author: sauer
Link to topic: https://cfengine.com/forum/read.php?3,24225,24233#msg-24233
So, all you really want to defer is your file copies running once an hour?
Perhaps you could define a class in your policy - say, "oktocopy" - and use the
splayclass function to set that. As in:
classes:
"oktocopy" expression => splayclass("$(sys.host)", "hourly");
That should be true only during the same 5 minute window as the splaytime would
be true, but gives you the advantage of being able to control individual
promises using the oktocopy class. It'd free up the possibility of evaluating
other promises more frequently. But you could also just negate the class and
use that as an abortclass so cf-agent (or a given bundle) would keel over if
the oktorun class wasn't set. And this is less likely to break upon a syntax
error (it could be duplicated to failsafe.cf if needed). :)
I personally run cf-execd using a 2 minute splaytime combined with a 15 minute
ifelapsed timer on the normal policy update promises (5 minutes on the
secondary masters' copies from the primary master, resulting in a 22 minute
maximum deployment delay for the non-critical policies), which is working well
in an environment where I have a separate policy server for every couple
thousand hosts. Using the ifelapsed timer in combination with the splayclass
means the updates are already staggered some by the CFEngine restart event, and
even if someone restarts all of the machines at midnight, they have varying
startup times and the 2 minute skew. I've been considering bumping the splay
time up to 4, but the policy is small enough for now that the secondary masters
are all keeping up just fine.
For the record, I do use the splayclass function to spread out some more
filesystem-intensive checks across an hour (using the path as the key to hash
upon). It's nice to not hammer on the disk when I can avoid it. :)
_______________________________________________
Help-cfengine mailing list
[email protected]
https://cfengine.org/mailman/listinfo/help-cfengine