On 28 Paź, 23:05, Oliver Nightingale <[EMAIL PROTECTED]
s.net> wrote:
> I have a production site that has a couple of batch jobs, I have used
> script/runner and cron to run these jobs.  This works ok for jobs that
> only run once overnight during off peak.
>
> I am expiring sessions older than 30 mins every 15 mins using
> script/runner, but I'm concerned about the hit of script/runner loading
> up the whole rails environment, specifically since I only have a 256MB
> slice, at such regular intervals.
>
> What is a more efficient way of clearing down these sessions (using AR
> store btw).
>
> Any help is appreciated

Have you checked what is consuming the memory?
The environment should take about 60mb (not 100% about that).
>From my experience most memory consuming operations are related with
creating objects from find(:all, ....) queries.
Can you change the ActiveRecord find into raw sql queries and compare
results?
I remember case with my code - memory usage jumped from 600mb do 180mb
after changing find(:all, ...) into sql.

The other thing is the script/runner - I don't know if it will make
any difference but you could try with rake task's instead of script/
runner.

cheers
--~--~---------~--~----~------------~-------~--~----~
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