Php – How to remove suspended IIS application pool

iis-8.5PHPwindows-server-2012-r2

I have a web server IIS 8.5. OS v: Windows Server 2012.

When number of Hit increase then huge php-cgi.exe open in windows process.But after some time lot of process shows suspended state.

As a result, site down and system make too slow to response. There have a recycling/ restart option in IIS application pool.

But, if i restart the application pool in every minute then current connected users will be unreachable. How we can remove only the suspended process.please check the images.

enter image description here
enter image description here
enter image description here

Best Answer

i have solved the problem.

Step1: Create a TaskKill command at your suitable.like:

taskkill  /IM "php-cgi.exe" /F  /FI "Username eq Yourusername" /FI "MemUsage lt 300" /T

most of the suspended process use below 300k memory usages. Task Kill detail parameter

Step2: create a batch file.like:

@echo off
taskkill  /IM "php-cgi.exe" /F  /FI "Username eq Yourusername.com" /FI "MemUsage lt 300" /T
:exit

Step3: Run the batch file every 5 min (or your required time) by windows task scheduler.

Go to

Control Panel->Administrative Tools->Task Scheduler

add the task to task scheduler.Configure Task Scheduler

That's all. You don't find any suspended process into your system.