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

Steve Winter steve at bluecrocodile.co.nz
Wed Mar 27 00:26:59 MDT 2013


Hi Jonathan

Almost certainly... At this point your best bet is to delete all but the last 24 hours worth (say) of session files using a script at the quietest time of the day for the server to minimise the impact this process will have on users.

Cheers
Steve

Sent from the iPhone of Steve Winter
Matatiro Solutions
steve at matatirosolutions.co.uk
+44 777 852 4776

On 26 Mar 2013, at 23:32, Jonathan Schwartz <jschwartz at exit445.com> wrote:

> A further question...
> 
> Let's say that gc is working in theory, but isn't being triggered often enough.  If, in a test script, the probability is raised to 1/1 to force gc to run, would that then start a process of deleting 2Million records...which could stall other processes for minutes...hours..days?
> 
> 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
> 
> 
> 
> _______________________________________________
> FX.php_List mailing list
> FX.php_List at mail.iviking.org
> http://www.iviking.org/mailman/listinfo/fx.php_list



More information about the FX.php_List mailing list