I need help understanding the pros and cons of these 2 facilities. Am I correct in assuming that this daemon by definitive runs in the rails environment, whereas a cron will have to load up a rail environment each time and thus consumer for more resources than the daemons gem? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Frederick Cheung
2008-Sep-26 16:19 UTC
Re: daemons gem vs cron jobs to execture rails code
On Sep 26, 5:13 pm, Rich Sturim <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> I need help understanding the pros and cons of these 2 facilities. > > Am I correct in assuming that this daemon by definitive runs in the > rails environment, whereas a cron will have to load up a rail > environment each time and thus consumer for more resources than the > daemons gem?The difference is that a daemon is a long running process (ie initialisation happens once), whereas a cronjob is something that is launched repeatedly. So yes, a cronjob spends more time loading rails/your app over and over again, but a daemon will set on however much memory it needs all the time, whereas a cronjob will return those resources when it has finished. To an extent the trade off depends how often you want to perform your task. Fred --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
nice summary -- thanks! -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
Rich (and Fred) On 26-Sep-08, at 12:19 PM, Frederick Cheung wrote:> > > > On Sep 26, 5:13 pm, Rich Sturim <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: >> I need help understanding the pros and cons of these 2 facilities. >> >> Am I correct in assuming that this daemon by definitive runs in the >> rails environment, whereas a cron will have to load up a rail >> environment each time and thus consumer for more resources than the >> daemons gem? > > The difference is that a daemon is a long running process (ie > initialisation happens once), whereas a cronjob is something that is > launched repeatedly. > So yes, a cronjob spends more time loading rails/your app over and > over again, but a daemon will set on however much memory it needs all > the time, whereas a cronjob will return those resources when it has > finished. To an extent the trade off depends how often you want to > perform your task. > > FredThe daemons gem (and plugin) can be run as per a cron-job (with regularity) - I think (?) it loads up the environment every time - but has a babysitting/launcher process to keep an eye on the spawn(ed). FWIW, I found this gem to be problematic (would stop running for no apparent reason), and monit had troubles restarting it. I''ve gone back to cron to do regular tasks. (wasn''t sure if you were talking about Daemons in general or the gem/ plugin. Fred''s description is correct with regard to daemons in general, and so the gem might be misnamed as it seems to be a railscron) Jodi --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---