We have seven websites written in PHP running on a Windows 2008 server with IIS 7.5. They are all very slow right now.
When I look in Task Manager, I see around 10 php-cgi.exe processes, and they are all taking 0% of the CPU, except one, which is taking 25%. It's a quad-core server, so it's taking 100% of one core.
If I watch for a few seconds, the process taking 25% will go to 0%, and a different php-cgi.exe process will jump to 25%. So all the php-cgi.exe processes are just lined up, waiting on a single core, and each process uses 100% of the processor when it can.
Each of the 7 sites is in its own application pool in IIS, and we're using FastCGI. The PHP version is 5.3.
Any ideas? Thanks!
EDIT: Here are our FastCGI settings:
<fastCgi>
<application fullPath="C:\Program Files (x86)\PHP\v5.3\php-cgi.exe" monitorChangesTo="C:\Program Files (x86)\PHP\v5.3\php.ini" activityTimeout="600" requestTimeout="600" instanceMaxRequests="10000">
<environmentVariables>
<environmentVariable name="PHP_FCGI_MAX_REQUESTS" value="10000" />
<environmentVariable name="PHPRC" value="C:\Program Files (x86)\PHP\v5.3" />
</environmentVariables>
</application>
</fastCgi>
EDIT #2: We partly figured it out. PHP was never garbage collecting sessions due to a permissions problem, so there were millions of session files.
But I'd still like to know why it only ever uses one core. The sites are much faster now, but we have not resolved that. Does anyone know?