PHP-CGI.exe running rampant. Which website

iisiis-7PHPphp56windows-server-2008

We have a Windows 2008 64-bit server running IIS 7 and serving about 40 different websites. Over the last few days we've seen a few php-cgi.exe processes consistently utilizing high CPU usage. The server is running PHP version 5.6.0 along with Windows Cache Extension for PHP 5.6. Both were installed with the Web Platform Installer.

Is there anyway for me to determine which website is the culprit so we can troubleshoot further?

Best Answer

If you can get to the server console while this is happening, you'll often be able to tell from Task Manager.

True story! But there's one tweak: turn on the view of the Command Line. This shows the arguments passed to the target process, from which you could typically infer the site/page/consumer.

  • Run Task Manager
  • Go to the tab where you can see process details (Processes from memory for 2008)
  • Right-click a column heading and choose Select Columns
  • Enable the Command Line column

Grabbing a process dump (or series of process dumps) from any errant high-CPU process(es) should also include the command line parameters passed to it (visible to the debugger).

If you need a snapshot of processes and related parameters in flight from the command line,

wmic process

looks like it gets it, as long as WMIC was in 2008.

Related Topic