Forum: Cfengine Help
Subject: Re: Random variable persistence problem -- crontab randomization
Author: jgreer
Link to topic: https://cfengine.com/forum/read.php?3,20077,20080#msg-20080


take care over this. Are you sure you want a "random time"? This is a commonly 
(ab)used phrase. What people usually want to do is the spread the times out 
evenly over an interval in a predictable way. A random time could have all 
hosts changing their behaviour all of the time, and might not spread out the 
numbers at all.


I understand.  You're right that a "random time" is not the goal, but 
distribution of the job more evenly (and predictably) across our hosts.  I do 
not want the hosts changing their behavior all the time (i.e., one host runs 
this job at 1:13, 2:07, 3:41...) - see requirement #1 in my original post.


What the splaytime does in Cfengine is to "hash" hosts over an interval of time 
so that as few hosts collide as possible and times are distributed evenly over 
the interval. That is not at all random, but it maps each host to a very 
specific time (whose value you don't particularly care about).


I'm aware of splaytime and prefer it for scheduling because of its finer 
granularity and persistence.  In this specific case, though, it's not a good 
solution, because of another business requirement: we schedule cf-execd to run 
the agent only at Min00 with a splaytime of 10 minutes, and we do not want  
agent runs to occur outside that window at the top of the hour.  We want to 
distribute the run of this cron job across the hour to prevent overloading a 
server to which the cron job syncs files.


If you want a predictable scheduling, I recommend running commands from inside 
Cfengine. Don't try to edit random numbers into the cron file.


Cfengine commands are our preferred method of scheduling.  While I'm trying to 
solve a scheduling problem, scheduling is not the heart of the problem I'm 
trying to solve - I'm interested to hear whether anyone has tried to solve the 
problem of generating "disposable," pseudo-random data client-side, and 
referring to that data in subsequent agent runs.  It's not a problem I've run 
into before, and don't know that I will again in practice, but was interested 
whether the community had thoughts on the matter.

Thanks,
-Jessica

_______________________________________________
Help-cfengine mailing list
Help-cfengine@cfengine.org
https://cfengine.org/mailman/listinfo/help-cfengine

Reply via email to