I'm developing an application where I need to have all sessions that
have been inactive for X minutes (in this case, I'm thinking 10
minutes, but I'm flexible to a point) automatically purged from the
database (using ActiveRecord session store).

What I've done is created a simple rake task that just looks at the
updated_at column and deletes anything older than 10 minutes.  I plan
to have a cron task run this job every 10 minutes.  In theory, this
should keep inactive sessions to a minimum and clean up my database
sessions at the same time automatically, keeping the number in the
table at any given time fairly low.

However, I'm concerned that running a rake task every 10 minutes
could have some performance issues.  Does anybody have any feedback on
this?  Is this generally considered "OK" or is there a better way
(that also can purge old sessions automatically)?
--~--~---------~--~----~------------~-------~--~----~
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 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to