megosh Posted June 10, 2010 Share Posted June 10, 2010 I've been doing some snooping around my dedicated to try and pinpoint the root of some lag spikes my game server has been encountering. Though I'm not entirely sure if this applies, it doesn't seem right. I'm running IIS7 with PHP 5.2.13. I found a massive (300,000+) number of sess_vvvv7ek73ce8f9hmns5i717762 (example) files in the save path: C:/Windows/Temp/. All but 15 have the prefix "sess_%". I've come to the understanding that these files should be cleaned by PHP every so often to prevent this from happening, though its clear its not actually doing that. I've looked through my php.ini and the most I found was that it was to clean those files after 24 mins or 1440 sec: session.gc_maxlifetime = 1440 I'm not entirely sure if this is the setting that specifically controls cleaning these files, but this is the best I could find. I've done a fair amount of searching on google but the best result I could find was a batch file that cleared out all "sess_" files every 24 hours. Does anyone know the cause of this problem? Any and all help would be greatly appreciated. - Doug Quote Link to comment https://forums.phpfreaks.com/topic/204412-excess-php-temp-session-files-not-being-cleaned/ Share on other sites More sharing options...
PFMaBiSmAd Posted June 10, 2010 Share Posted June 10, 2010 What does a phpinfo(); statement show for the following three settings - session.gc_divisor session.gc_maxlifetime session.gc_probability Quote Link to comment https://forums.phpfreaks.com/topic/204412-excess-php-temp-session-files-not-being-cleaned/#findComment-1070469 Share on other sites More sharing options...
megosh Posted June 10, 2010 Author Share Posted June 10, 2010 session.gc_divisor 1000 1000 session.gc_maxlifetime 1440 1440 session.gc_probability 1 1 Direct copy-paste from phpinfo(); Quote Link to comment https://forums.phpfreaks.com/topic/204412-excess-php-temp-session-files-not-being-cleaned/#findComment-1070477 Share on other sites More sharing options...
PFMaBiSmAd Posted June 10, 2010 Share Posted June 10, 2010 And what permissions does the IIS user have for the C:/Windows/Temp/ folder? I suspect only read/write but not delete permissions? Quote Link to comment https://forums.phpfreaks.com/topic/204412-excess-php-temp-session-files-not-being-cleaned/#findComment-1070485 Share on other sites More sharing options...
megosh Posted June 10, 2010 Author Share Posted June 10, 2010 At first glance, that appears to be the cause... However I'll be unable to change anything until later this evening. Will report back here with results, thanks for your quick responses. Quote Link to comment https://forums.phpfreaks.com/topic/204412-excess-php-temp-session-files-not-being-cleaned/#findComment-1070494 Share on other sites More sharing options...
megosh Posted June 11, 2010 Author Share Posted June 11, 2010 Yep, that was the problem. Everything is working perfectly. Thank you for your help, PFMaBiSmAd. Quote Link to comment https://forums.phpfreaks.com/topic/204412-excess-php-temp-session-files-not-being-cleaned/#findComment-1070867 Share on other sites More sharing options...
PFMaBiSmAd Posted June 11, 2010 Share Posted June 11, 2010 Thank you for reporting back with the actual cause of the problem Quote Link to comment https://forums.phpfreaks.com/topic/204412-excess-php-temp-session-files-not-being-cleaned/#findComment-1070877 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.