[ic] Re: SessionExpire and cleaning up sessions
emailgrant at gmail.com
Mon May 28 14:21:13 EDT 2007
> >> I use 'SessionExpire 2 days' in catalog.cfg, and the following is run
> >> nightly to clean up sessions:
> >> # find /pathto/catalog/tmp -type f -mmin +480 | xargs --no-run-if-empty rm
> >> # find /pathto/catalog/tmp -type d -empty -depth -mindepth 1 | xargs
> >> --no-run-if-empty rmdir
> >> # find /pathto/catalog/session -type f -mmin +480 | xargs --no-run-if-empty
> >> rm
> >> # find /pathto/catalog/session -type d -empty -depth -mindepth 1 |
> >> xargs --no-run-if-empty rmdir
> >> Do those entries clean up all sessions, active and inactive? If so,
> >> is there a way to clean up sessions only after 2 days of inactivity?
> >> Should I put my sessions in a DBM or mysql database instead of in files?
> > Sorry to reply to myself, but I looked into the -mmin +480 parameter and
> > apparently the command won't clean up a session unless it has been
> > inactive for 8 hours. I changed the parameters to -mmin +2940 so they
> > won't be cleaned up unless inactive for 49 hours. That should give
> > SessionExpire a chance to kick in first at 48 hours.
> > Does that seem OK?
> Sounds fine. I don't know of any importance for SessionExpire to apply
> before you delete the session; it's basically the same either way.
Ok, got rid of SessionExpire.
> You can use the -mtime argument to find to specify days if you fine -mmin
> +2940 to be too obscure. :)
Perfect. I set up -mtime 3.
> > I'm still wondering about switching from files to a real DB for
> > sessions.
> I wouldn't recommend it unless you have a real reason. Sessions stored in
> files on a local filesystem are generally the most efficient and easy to
> manage and prevent fewer locking difficulties than DBM or MySQL with
> MyISAM tables.
Ok, I'm surprised to hear that. Thanks for your help.
More information about the interchange-users