Too many SESSIONS?

I just notices my app was down, and in the log file were lots of these:

No space left on device -
…/config/…/tmp/sessions//ruby_sess.898b1cf95e14f8e3

So i figured that i had too many sessions. I went through and deleted
the sessions and then in a few minutes, the site was back up again.

Can anyone explain this?

Did I do the right thing?

Is there a way I can tell my app to accept more sessions? clean up after
Xmb?

thanks!

mk

A simple cron job to keep the tmp/sessions in order should do the trick.

Chris

On 8/16/06, Chris R. [email protected] wrote:

Is there a way I can tell my app to accept more sessions? clean up after
Xmb?

http://www.realityforge.org/articles/2006/03/01/removing-stale-rails-sessions

I followed what this person did, but changed the time to 1 day instead
of twenty minutes.

Mason K. wrote:

Is there a way I can tell my app to accept more sessions? clean up after
Xmb?

Here’s a script I wrote that you can hook right into your code:

http://alevans.com/dl/session_cleanup-0.3.0.tgz

You just put it into the lib directory, find a place in your code to
call it where a second or two extra won’t matter, set the calling
frequency and maximum session age, and it will clean up stale sessions
every X hours. Optionally, it will even call back with the data from
each session, in case you need to do anything with it (other cleanup,
etc.).

–Al Evans

Switch to ActiveRecord sessions, and eliminate this problem
and get a speed boost as well.

Tom M. wrote:

Switch to ActiveRecord sessions, and eliminate this problem
and get a speed boost as well.

Yes! Details on changing to the ActiveRecord Store are here:
http://wiki.rubyonrails.com/rails/pages/HowtoChangeSessionStore

But make sure you intermittently remove THOSE stale sessions out of the
database - they aren’t cleaned automatically:
http://www.realityforge.org/articles/2006/03/01/removing-stale-rails-sessions

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs