We had an issue with too many sessions which were stored in database for each user. The problem was that all sessions were keep and did not get cleared up. We managed to solve this problem.
At first we have tried to solve our problem by changing following parameters in settings.php (sessions.cache_expire & session.gc_maxlifetime set to 1800). Please see below:
@ini_set('arg_separator.output', '&');
@ini_set('magic_quotes_runtime', 0);
@ini_set('magic_quotes_sybase', 0);
@ini_set('session.cache_expire', 1800);
@ini_set('session.cache_limiter', 'none');
@ini_set('session.cookie_lifetime', 0);
@ini_set('session.gc_maxlifetime', 1800);
@ini_set('session.save_handler', 'user');
@ini_set('session.use_only_cookies', 1);
@ini_set('session.use_trans_sid', 0);
@ini_set('url_rewriter.tags', '');
But, as defaut values, this did not work. Drupal is clearing sessions table by using sess_gc that should be triggered when php is doing garbage collection. Next we have done some manual approaches, which got us pass the sticking point.
Next we installed session_expire module that is clearing sessions table on cron run. This appeared to be the best solution, as it did enable expired session cleanup.
We have noticed that on the single instance Drupal site this module was not necessary to get rid of expired sessions.
It appears that on all of our instances under Aegir host master, this additional module's functionality was necessary.
Does Aegir takes control of this somehow, and we do not understand how to work with it?
Do you know how does Aegir and its hosted sites handle this issue?
Is there a recommend approach for Aegir hosted sites?
Thank you,
Dejan
Kontrola
Comments
Aegir doesn't take control of
Aegir doesn't take control of this, as far as I know. What operating system are you using?
This awfully looks like an issue Debian has with Drupal, in general, and that seems to have been fixed in D7, which added the following to the settings.php:
/*** Some distributions of Linux (most notably Debian) ship their PHP
* installations with garbage collection (gc) disabled. Since Drupal depends on
* PHP's garbage collection for clearing sessions, ensure that garbage
* collection occurs by using the most common settings.
*/
ini_set('session.gc_probability', 1);
ini_set('session.gc_divisor', 100);
Seems like it's something we should be adding... Could you open an issue about this?
That is good to know. I
That is good to know. I wanted to verify if Aegir does something here.
We already did try this:
but it did not work for us. It does makes sense to add this and I am glad to hear that this is probably taken care of in D7.
No problem on opening this issue. Can you recommend me where it makes sense to open / post this issue?
Thank you.
Submit the issue on the
Submit the issue on the provision project and describe clearly what you are doing to fix it, along with the rest of the stuff recommended in the bug submission guidelines.
Just stumbled upon the same
Just stumbled upon the same issue and found this module that looks like it will fix the problem: http://drupal.org/project/session_expire
I know this is an old discussion but I thought it might help anyone else who ends up here.