Forum: Ruby on Rails Script/Runner

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Oliver N. (Guest)
on 2008-10-29 00:05
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

reHa (Guest)
on 2008-10-29 00:24
(Received via mailing list)
On 28 Pa┬╝, 23:05, Oliver Nightingale <rails-mailing-l...@andreas-> wrote:
> 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
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/

This topic is locked and can not be replied to.