Add $config['sessions']['gc_limit'] to limit how much work we do in each session GC; defaulting to killing 1000 sessions at a time.
This commit is contained in:
parent
73011e6344
commit
433ec21119
|
@ -156,6 +156,13 @@ class Session extends Memcached_DataObject
|
|||
$session->selectAdd();
|
||||
$session->selectAdd('id');
|
||||
|
||||
$limit = common_config('sessions', 'gc_limit');
|
||||
if ($limit > 0) {
|
||||
// On large sites, too many sessions to expire
|
||||
// at once will just result in failure.
|
||||
$session->limit($limit);
|
||||
}
|
||||
|
||||
$session->find();
|
||||
|
||||
while ($session->fetch()) {
|
||||
|
|
|
@ -261,8 +261,9 @@ $default =
|
|||
'search' =>
|
||||
array('type' => 'fulltext'),
|
||||
'sessions' =>
|
||||
array('handle' => false, // whether to handle sessions ourselves
|
||||
'debug' => false), // debugging output for sessions
|
||||
array('handle' => false, // whether to handle sessions ourselves
|
||||
'debug' => false, // debugging output for sessions
|
||||
'gc_limit' => 1000), // max sessions to expire at a time
|
||||
'design' =>
|
||||
array('backgroundcolor' => null, // null -> 'use theme default'
|
||||
'contentcolor' => null,
|
||||
|
|
Loading…
Reference in New Issue
Block a user