Clear sessions more freqently
rmiddle - February 2, 2009 - 19:30
| Project: | Session expire |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Description
I moved the options for cron job down to 5 min. and I moved the purge times down to 30 min.
Thanks
Robert
| Attachment | Size |
|---|---|
| session_expire.patch | 1.65 KB |

#1
This patch should work with both 5 and 6. It is really small.
Thanks
Robert
#2
This is too frequent to be of general use. It would also be too heavy for cron.
However, if a couple more people voice their support for this, I will include it.
#3
Well it is cool either way. I didn't remove any options or change the default but it is your call.
Thanks
Robert
#4
Looks good to me. I didn't experience any problems with the times. No one is forced to use the new values.
#5
Nancy
From your answer, it seems that you did not need less times as per this patch. Do you have a need for such more frequent timing?
That was the gist of my request from comments, not whether the patch looks good.
#6
I went down to 5 mins and the load on the server was not noticeable, even with cron running every 15 mins.
#7
Oh, you might want to have a way to occasionally OPTIMIZE the sessions table. Mine had way more overhead space that it was using.
#8
kbahey,
I don't want you to do something you don't wont to do but I my case I need this ability and I hate having to manage forks. There are two changes here. One is how frequently to run the query and the 2nd is how old should the session be before the purge. Witch part do you object to.
Thanks
Robert
#9
I know what the changes do. The code is clear, and the changes are minimal.
My concerns are two fold:
- Sites normally run cron every hour. Although the settings of this module say you have to run it more frequently, people may get confused.
- Running cron that frequently may cause the site to slow down more frequently. Not only will we be running against sessions table, which is used all the time, but also search tables and other stuff. The locking can be problematic for large sites.
But note that I did not mark "wont fix". I am asking the community at large if such a use case is useful for others, so I don't turn down a potentially useful feature.
#10
I can understand the first one what if I removed 1 hour and lower and added every for every cron run. That would remove the possible confusion on the 1st one.
Thanks
Robert
#11
I think that would be good.
#12
@kbahey: Not one of my sites runs hourly. I have the one site that runs every 15 minutes, several that run every 6 hours, and several more that run but once a day.
#13
Updated Patch.
#14
Committed to 5.x and 6.x
Thank you.
#15
@Khalid: have you considered Robert as a co-maintainer? I know his work is good.
#16
Automatically closed -- issue fixed for 2 weeks with no activity.