[FX.php List] API: PHP not doing Garbage Collection of sess_ files in Windows/Temp

Jonathan Schwartz jschwartz at exit445.com
Tue Mar 26 16:16:35 MDT 2013


Hi Steve,

The values for the gc setting are the default in all three systems. Working for two remote systems at Amazon AWS, but not the one problematic local system:

	session.gc_probability: 1
	session.gc_divisor	1000
	session.gc_maxLifetime	1440

Sure, 1/1000 is low but that seems to be the default values that works elsewhere.

Disk on the troubled system is NTFS.

For reference, I do not add any gc statements in my php pages.  Just session_start()  and set_time_limit(60);  Sessions rarely get destroyed because web users usually just leave the site when they are done.

From the looks of things, I don't think gc is working at all.  But to test that theory, I will find the oldest several files and watch to see if they are being deleted.  Just working with the files in DOS is a chore for the Hard Drive given the quantity (2M).

Jonathan


On Mar 26, 2013, at 2:24 PM, Steve Winter wrote:

> Howdy
> 
> Chances are that the issue is that the garbage collection is seth such that the probability if it running is so close to zero that it never does…!
> 
> What are your values for
> 	session.gc_probability
> 	session.gc_divisor
> 	session.gc_maxLifetime
> 
> And what does session.gc_probability / session.gc_divisor equal, since this is the probability that the garbage collection will run on any given session_start() call - if that's zero, or very very low, then that would explain why the files were still there and garbage collection had never run… also if session.gc_maxLifetime is very high (though admittedly it would have to be very high given what you describe) then files will never be seen as garbage, so though collection may have run then all files may have been seen not to be garbage.
> 
> Final idea, what is the filesystem type of the drive which the session files are on (though this is unlikely with Win2008) if the filesystem type where the session files are is FAT, then it's possible that the modified timestamp isn't available and so PHP can't determine how old a file is…
> 
> Plan B is a perfectly sensible option as well ;-)
> 
> Cheers
> Steve
> 
> 
>> Hi Folks,
>> 
>> In troubleshooting a Web Publishing problem, I discovered over 2 Millions "sess_" files in the C:\Windows'Temp folder, dating back to when the server was first installed.  In short, the initial problem was solved when I deleted a portion of the files.  It seems that PHP was unable to create a session due to the condition of the folder. Now it can.
>> 
>> My attention is now turned to why Garbage Collection isn't working on the files in this folder.  The php.ini is stock from FileMaker Web Publishing deployment, including path and GC settings. Session.save_Path is "No Value", which is default. I don't believe that the Windows/Temp folder has been altered.  I don't see any php errors relating to failure to to access the folder.  It can certainly create the records.  They are just not being deleted.
>> 
>> I have two other Windows systems that are maintaing the proper files level as expected.
>> 
>> All machines are FMS 12. and Windows Server 2008 R2
>> 
>> Any suggestions?
>> 
>> PLAN B is to use a Scheduled Task to manually delete the stale sess files, but I'd rather figure this one out.
>> 
>> Thanks
>> 
>> Jonathan
>> 
>> Jonathan Schwartz
>> jschwartz at exit445.com
>> 
>> 
>> 
>> _______________________________________________
>> FX.php_List mailing list
>> FX.php_List at mail.iviking.org
>> http://www.iviking.org/mailman/listinfo/fx.php_list
> 
> Steve Winter
> +44 777 852 4776
> steve at bluecrocodile.co.nz
> 
> 
> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list

Jonathan Schwartz
jschwartz at exit445.com





More information about the FX.php_List mailing list