I ended up writing a custom rand_fqdn function based heavily off the
standard rand_fqdn.  In my environment, we have a lot of related system
(e.g. webs001, webs002, webs003), many of which have significant startup
times.  I changed the function to split an incoming hostname into a
name+numeric suffix (or zero if there is none).  Then it uses the standard
rand algorithm on the name part and multiplies the suffix by 5 and adds that
in with an appropriate modulus.  This means that for all the "webs" hosts,
there is a standard base time, after which they are staggered at 5 minutes
intervals (overlapping every 6th, of course).  The end result is that no
matter what happens with the rand() function, an entire group of servers is
never restarted at the same time.

On Mon, Sep 26, 2011 at 1:10 AM, Ohad Levy <ohadl...@gmail.com> wrote:

> On Mon, Sep 26, 2011 at 12:29 AM, Scott Smith <sc...@ohlol.net> wrote:
> > Ohad, was rand_fqdn not sufficient for you?
>
> well.. I did it a long time ago, so I'm not 100% sure, but I think the
> main reason was to allow to manage cron entries over an interval, e.g.
> 3 times an hour, or 7 times a day in a random fashion.
>
> Ohad
> >
> > On Sep 25, 2011 1:03 PM, "Ohad Levy" <ohadl...@gmail.com> wrote:
> >> On Sun, Sep 25, 2011 at 10:33 PM, treydock <treyd...@gmail.com> wrote:
> >>>
> >>>
> >>> On Sep 24, 9:42 pm, Aaron Grewell <aaron.grew...@gmail.com> wrote:
> >>>> We had frequent inexplicable daemon crashes on Solaris, but not on
> RHEL5
> >>>> (at
> >>>> least not yet) .   Given known issues with memory leakage in older
> Ruby
> >>>> releases Cron seemed more likely to be reliable.   We stuck a random
> >>>> wait in
> >>>> the Cron job to spread load on the master and so far it works well.
> >>>> On Sep 24, 2011 7:22 AM, "treydock" <treyd...@gmail.com> wrote:
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>> > On Sep 23, 5:42 pm, Brian Gupta <brian.gu...@brandorr.com> wrote:
> >>>> >> Over the years many shops have come to start running puppet via
> cron
> >>>> >> to
> >>>> >> address memory leaks in earlier versions of Ruby, but the official
> >>>> position
> >>>> >> was that puppet was meant to be run as a continually running
> service.
> >>>>
> >>>> >> I am wondering if the official position has changed. On one hand
> many
> >>>> >> if
> >>>> not
> >>>> >> all of the early Ruby issues have been fixed, on the other, the
> >>>> >> addition
> >>>> of
> >>>> >> mcollective into the mix as a lightweight agent for triggering
> adhoc
> >>>> puppet
> >>>> >> runs, and other tasks somewhat lowers the requirements for puppet
> to
> >>>> >> be
> >>>> run
> >>>> >> as a service. (Or out of cron for that matter).
> >>>>
> >>>> >> I understand that in cases where old Ruby versions are for whatever
> >>>> reason
> >>>> >> mandated the answer may be different.
> >>>>
> >>>> >> Thanks,
> >>>> >> Brian
> >>>>
> >>>> >> --
> >>>> >> <http://aws.amazon.com/solutions/solution-providers/brandorr/>
> >>>>
> >>>> > Could those memory leak problems cause the Puppet daemon to crash
> with
> >>>> > no logs indicating why? I have about 20 systems all running CentOS 5
> >>>> > and 6, with Puppet 2.6.9, and I now have to have Zabbix run a "/etc/
> >>>> > init.d/puppet start" everytime the daemon crashes which is almost on
> a
> >>>> > daily basis for every client. Would be interested to know of a known
> >>>> > fix or if the only "fix" is the workaround of using Cron.
> >>>>
> >>>> > Thanks
> >>>> > - Trey
> >>>>
> >>>> > --
> >>>> > You received this message because you are subscribed to the Google
> >>>> > Groups
> >>>>
> >>>> "Puppet Users" group.> To post to this group, send email to
> >>>> puppet-users@googlegroups.com.
> >>>> > To unsubscribe from this group, send email to
> >>>>
> >>>> puppet-users+unsubscr...@googlegroups.com.> For more options, visit
> this
> >>>> group at
> >>>>
> >>>> http://groups.google.com/group/puppet-users?hl=en.
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>> Could you share how you did the random wait?  I may have to switch to
> >>> a cron job with how often my daemons are crashing and having to be
> >>> restarted by Zabbix.
> >>
> >> I used the ip_to_cron function from
> >> http://projects.puppetlabs.com/projects/1/wiki/Cron_Patterns
> >>
> >> afterwards, I just do a sleep random 59, so its also random within the
> >> minute.
> >>
> >> Ohad
> >>>
> >>> Thanks
> >>>  - Trey
> >>>
> >>> --
> >>> You received this message because you are subscribed to the Google
> Groups
> >>> "Puppet Users" group.
> >>> To post to this group, send email to puppet-users@googlegroups.com.
> >>> To unsubscribe from this group, send email to
> >>> puppet-users+unsubscr...@googlegroups.com.
> >>> For more options, visit this group at
> >>> http://groups.google.com/group/puppet-users?hl=en.
> >>>
> >>>
> >>
> >> --
> >> You received this message because you are subscribed to the Google
> Groups
> >> "Puppet Users" group.
> >> To post to this group, send email to puppet-users@googlegroups.com.
> >> To unsubscribe from this group, send email to
> >> puppet-users+unsubscr...@googlegroups.com.
> >> For more options, visit this group at
> >> http://groups.google.com/group/puppet-users?hl=en.
> >>
> >
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Puppet Users" group.
> > To post to this group, send email to puppet-users@googlegroups.com.
> > To unsubscribe from this group, send email to
> > puppet-users+unsubscr...@googlegroups.com.
> > For more options, visit this group at
> > http://groups.google.com/group/puppet-users?hl=en.
> >
>
> --
> You received this message because you are subscribed to the Google Groups
> "Puppet Users" group.
> To post to this group, send email to puppet-users@googlegroups.com.
> To unsubscribe from this group, send email to
> puppet-users+unsubscr...@googlegroups.com.
> For more options, visit this group at
> http://groups.google.com/group/puppet-users?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Puppet Users" group.
To post to this group, send email to puppet-users@googlegroups.com.
To unsubscribe from this group, send email to 
puppet-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/puppet-users?hl=en.

Reply via email to