Rich (and Fred)

On 26-Sep-08, at 12:19 PM, Frederick Cheung wrote:

>
>
>
> On Sep 26, 5:13 pm, Rich Sturim <[EMAIL PROTECTED]>
> 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

The 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@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to