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

AttachmentSize
session_expire.patch1.65 KB

#1

rmiddle - February 2, 2009 - 19:31

This patch should work with both 5 and 6. It is really small.

Thanks
Robert

#2

kbahey - February 2, 2009 - 19:48
Title:I need my sessions cleared a little more freqently the you have it setup for.» Clear sessions more freqently
Status:needs review» active

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

rmiddle - February 2, 2009 - 19:55

Well it is cool either way. I didn't remove any options or change the default but it is your call.

Thanks
Robert

#4

NancyDru - February 2, 2009 - 20:25
Status:active» reviewed & tested by the community

Looks good to me. I didn't experience any problems with the times. No one is forced to use the new values.

#5

kbahey - February 2, 2009 - 20:28
Status:reviewed & tested by the community» needs review

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

NancyDru - February 2, 2009 - 20:31

I went down to 5 mins and the load on the server was not noticeable, even with cron running every 15 mins.

#7

NancyDru - February 2, 2009 - 20:33

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

rmiddle - February 2, 2009 - 20:57

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

kbahey - February 2, 2009 - 21:04

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

rmiddle - February 2, 2009 - 21:15

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

kbahey - February 2, 2009 - 22:15

I think that would be good.

#12

NancyDru - February 2, 2009 - 23:19

@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

rmiddle - February 2, 2009 - 23:22

Updated Patch.

AttachmentSize
session_expire.patch 1.66 KB

#14

kbahey - February 5, 2009 - 03:03
Status:needs review» fixed

Committed to 5.x and 6.x

Thank you.

#15

NancyDru - February 5, 2009 - 06:03

@Khalid: have you considered Robert as a co-maintainer? I know his work is good.

#16

System Message - February 19, 2009 - 06:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.