Forum: Ruby on Rails Script/Runner

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9e6cea50e29d29bc50213c291bf7bfb7?d=identicon&s=25 Oliver Nightingale (olivernn)
on 2008-10-28 23: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

Thanks
5acf8e6be07793d22e24d8eb24a0e043?d=identicon&s=25 reHa (Guest)
on 2008-10-28 23:24
(Received via mailing list)
On 28 Pa┬╝, 23:05, Oliver Nightingale <rails-mailing-l...@andreas-
s.net> 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
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
This topic is locked and can not be replied to.