Jump to content


Photo

Excess PHP Temp Session Files not being cleaned.


  • Please log in to reply
6 replies to this topic

#1 megosh

megosh

    Member

  • Members
  • PipPip
  • 12 posts

Posted 10 June 2010 - 01:52 PM

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

#2 PFMaBiSmAd

PFMaBiSmAd

    Advanced Member

  • Staff Alumni
  • 16,767 posts
  • LocationColorado, U.S.A.

Posted 10 June 2010 - 02:10 PM

What does a phpinfo(); statement show for the following three settings -

session.gc_divisor
session.gc_maxlifetime
session.gc_probability
Signature: (not a comment about anything you posted unless specifically indicated)
Debugging step #1: To get past the garbage-out equals garbage-in stage in your code, you must check that the inputs to your code are what you expect.

Programming is just problem solving, but it is done in another language. You must learn enough of the programming language you are using to be able to read and write code.

#3 megosh

megosh

    Member

  • Members
  • PipPip
  • 12 posts

Posted 10 June 2010 - 02:29 PM

session.gc_divisor 1000 1000
session.gc_maxlifetime 1440 1440
session.gc_probability 1 1

Direct copy-paste from phpinfo();

#4 PFMaBiSmAd

PFMaBiSmAd

    Advanced Member

  • Staff Alumni
  • 16,767 posts
  • LocationColorado, U.S.A.

Posted 10 June 2010 - 02:42 PM

And what permissions does the IIS user have for the C:/Windows/Temp/ folder? I suspect only read/write but not delete permissions?
Signature: (not a comment about anything you posted unless specifically indicated)
Debugging step #1: To get past the garbage-out equals garbage-in stage in your code, you must check that the inputs to your code are what you expect.

Programming is just problem solving, but it is done in another language. You must learn enough of the programming language you are using to be able to read and write code.

#5 megosh

megosh

    Member

  • Members
  • PipPip
  • 12 posts

Posted 10 June 2010 - 02:51 PM

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.

#6 megosh

megosh

    Member

  • Members
  • PipPip
  • 12 posts

Posted 11 June 2010 - 01:40 PM

Yep, that was the problem. Everything is working perfectly. Thank you for your help, PFMaBiSmAd.

#7 PFMaBiSmAd

PFMaBiSmAd

    Advanced Member

  • Staff Alumni
  • 16,767 posts
  • LocationColorado, U.S.A.

Posted 11 June 2010 - 01:54 PM

Thank you for reporting back with the actual cause of the problem  :)
Signature: (not a comment about anything you posted unless specifically indicated)
Debugging step #1: To get past the garbage-out equals garbage-in stage in your code, you must check that the inputs to your code are what you expect.

Programming is just problem solving, but it is done in another language. You must learn enough of the programming language you are using to be able to read and write code.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

Cheap Linux VPS from $5
SSD Storage, 30 day Guarantee
1 TB of BW, 100% Network Uptime

AlphaBit.com