What is your motivation for removing these rows at all?  Generally, large
database tables that are properly indexed shouldn't pose much of a
performance concern.

On Mon, Aug 3, 2009 at 3:45 PM, Phoenix Rising <[email protected]>wrote:

>
> 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)?
> >
>


-- 
=====================
Jim
http://www.thepeoplesfeed.com/contribute

--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
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