Weblog entry #444 for simonw
#444
Windows web server slow
Posted by simonw on Fri 9 Mar 2012 at 03:26
Looking at this box because we wrote a small bit of the software on it, and the current provider said "we can reinstall Windows" (which is a classic Windows Admin thing, if in doubt reinstall).
Server runs Microsoft Web Server 2003, PHP 5.3.9 MySQL 5.1
Symptom was it got slower, quickly becoming unusable over the period of a few days. Initially rebooting or restarting services seemed to help, but later on that was less clear. Performance tools didn't show bottle-necking on IO, or Memory, or CPU, and I found a similar report claiming IIS6 might need its worker threads tuned - but no.
No change could be identified as causing the problem.
Still troubleshooting, but looks like the most probable cause was PHP (and other apps) not removing temporary files from C:\WINDOWS\TEMP
How many files in c:\WINDOWS\TEMP? Well I gave up waiting for the command counting them to complete. Been deleting (del ses_*)_ them for 5 hours, my best estimate is it deleted the first fifth in about 2 hours of deleting.
So reinstalling would probably have fixed the problem for a couple of months ;)
I note also deleting a large number of files from a folder in Microsoft Windows with NTFS is not terribly fast. Suddenly all those benchmarks comparing file-systems whilst they compile kernels or move ISOs suddenly seems so much more sensible. Anyone happen to know if NTFS is likely to be irreparably damaged by having a folder with a million files in (I mean I know it SHOULD cope, but clearly it doesn't).
Server runs Microsoft Web Server 2003, PHP 5.3.9 MySQL 5.1
Symptom was it got slower, quickly becoming unusable over the period of a few days. Initially rebooting or restarting services seemed to help, but later on that was less clear. Performance tools didn't show bottle-necking on IO, or Memory, or CPU, and I found a similar report claiming IIS6 might need its worker threads tuned - but no.
No change could be identified as causing the problem.
Still troubleshooting, but looks like the most probable cause was PHP (and other apps) not removing temporary files from C:\WINDOWS\TEMP
How many files in c:\WINDOWS\TEMP? Well I gave up waiting for the command counting them to complete. Been deleting (del ses_*)_ them for 5 hours, my best estimate is it deleted the first fifth in about 2 hours of deleting.
So reinstalling would probably have fixed the problem for a couple of months ;)
I note also deleting a large number of files from a folder in Microsoft Windows with NTFS is not terribly fast. Suddenly all those benchmarks comparing file-systems whilst they compile kernels or move ISOs suddenly seems so much more sensible. Anyone happen to know if NTFS is likely to be irreparably damaged by having a folder with a million files in (I mean I know it SHOULD cope, but clearly it doesn't).
Comments on this Entry
The unstated expectation being it would have performance characteristics comparable to Linux ext3/reiserfs 3/ext4 etc? It has removed the files, somewhere between 36 and 48 hours of deleting, it appears not to have cleaned up the folder meta-data (the directory itself is still appearing in defrag reports as the most fragmented item, but presumably that will go if/when the drive is defragged).
[ Parent | Reply to this comment ]
The problem was PHP not clearing out session files. When the PHP temporary files were moved to a different folder this issue went away (PHP was able to clean out the old session files at their expiry time), so I presume the underlying issue was a permissions issue on C:\WINDOWS\TEMP.
Aside from gradual performance loss, the first indication of an issue is that MYSQL 5.1 would no longer start as a Windows service but was timing out, but needed to start from the command line using the "--verbose" option. I presume the verbose option somehow prevents or reduces the use that MySQL makes of the C:\WINDOWS\TEMP folder when starting up, which is MySQL's default place to create temporary files in Windows.
Aside from gradual performance loss, the first indication of an issue is that MYSQL 5.1 would no longer start as a Windows service but was timing out, but needed to start from the command line using the "--verbose" option. I presume the verbose option somehow prevents or reduces the use that MySQL makes of the C:\WINDOWS\TEMP folder when starting up, which is MySQL's default place to create temporary files in Windows.
[ Parent | Reply to this comment ]
[ Parent | Reply to this comment ]