#50733 [Opn->Bgs]: Garbage Collection fails

From: Date: Wed, 13 Jan 2010 15:28:42 +0000
Subject: #50733 [Opn->Bgs]: Garbage Collection fails
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-146617@lists.php.net to get a copy of this message
 ID:               50733
 Updated by:       jani@php.net
 Reported By:      elmex at voll dot in
-Status:           Open
+Status:           Bogus
 Bug Type:         Session related
 Operating System: FreeBSD 6.1
 PHP Version:      5.2.12
 New Comment:

You just misunderstood how the GC works. Your settings mean that GC
happening has in 1/1000 chance per request. And that happens only for
session files older than 1440 seconds. No bug.


Previous Comments:
------------------------------------------------------------------------

[2010-01-13 14:54:56] elmex at voll dot in

Sure, here they are (from php_info):

Session Support 	enabled
Registered save handlers 	files user
Registered serializer handlers 	php php_binary

Directive	Local Value	Master Value
session.auto_start	Off	Off
session.bug_compat_42	Off	Off
session.bug_compat_warn	On	On
session.cache_expire	180	180
session.cache_limiter	nocache	nocache
session.cookie_domain	no value	no value
session.cookie_httponly	Off	Off
session.cookie_lifetime	0	0
session.cookie_path	/	/
session.cookie_secure	Off	Off
session.entropy_file	no value	no value
session.entropy_length	0	0
session.gc_divisor	1000	1000
session.gc_maxlifetime	1440	1440
session.gc_probability	1	1
session.hash_bits_per_character	5	5
session.hash_function	0	0
session.name	PHPSESSID	PHPSESSID
session.referer_check	no value	no value
session.save_handler	files	files
session.save_path	/usr/local/www/XXXX/phptmp	no value
session.serialize_handler	php	php
session.use_cookies	On	On
session.use_only_cookies	Off	Off
session.use_trans_sid	0	0

------------------------------------------------------------------------

[2010-01-12 22:07:23] derick@php.net

Can you post the other session related settings a well?

------------------------------------------------------------------------

[2010-01-12 21:32:36] elmex at voll dot in

Description:
------------
The Garbage Collection ist set to session.gc_maxlifetime=1440, but
there are a lot of session files set are older. In all hosts on the
server there is a virtual host setting for session.save_path like
session.save_path="/usr/local/www/hostname/phptmp". That is the only
session related setting, that was modified. A find for the files shows
currently:

find /usr/local/www/ -maxdepth 3 -mindepth 3 -name 'sess_*' -cmin +24 |
wc -l
    8443

(amin is the same:)

find /usr/local/www/ -maxdepth 3 -mindepth 3 -name 'sess_*' -amin +24 |
wc -l
    8443



Reproduce code:
---------------
no code, just settings

Expected result:
----------------
session files should be deleted after session.gc_maxlifetime or earlier

Actual result:
--------------
session files are not deleted or deleted too late


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=50733&edit=1



Thread (4 messages)

« previous php.bugs (#146617) next »