The web server process that was being debugged has been terminated by Internet Information Services (IIS). This can be avoided by configuring Application Pool ping settings in IIS.


 

A lot of developers might have seen following dialog box while debugging any web application in Microsoft Visual Studio.

“The web server process that was being debugged has been terminated by Internet Information Services (IIS). This can be avoided by configuring Application Pool ping settings in IIS. See help for further details.”

image

 

Explanation:

This issue happens when you have hosted your web application in IIS and have attached the debugger to the worker process.

While debugging, you might stop at any particular line for some long time for any reason say some calculation, quick watch window etc, so when debugger stops execution of the code, Internet Information Services (IIS) assumes that worker process has stopped responding and terminates that worker process. Subsequently, Visual Studio will show this dialog box since it’s debugger was attached to that process. So question might arise how does IIS gets to know if any process is stopped or is hung? Answer to this question lies in the solution explained below.

Solution:

When we host any application in the IIS, most of the times, we do not change the default settings and our application inherits settings defined at the IIS level. Here are two such settings which can cause above issue if not set properly. To change these settings, follow below steps.

1. Launch IIS manager, select application pool of the website, click on advanced settings.

image 

 

2. You will see following dialog box. You see following two settings. You can use any one of the below given settings to resolve this issue. 

a. Ping Enabled –> Set to False

b. Ping Maximum Response Time –> Set some higher number.

image

 

Ping Enabled: This feature is for monitoring and improving application pool health by having the Windows Process Activation Service (WAS) ping an application pool’s worker process at set intervals. Setting it turned off will stop IIS from checking whether the worker process is still running or if this is hung, which will stop IIS from reporting it.

Explanation: If true, the worker process(es) serving this application pool are pinged periodically to ensure that they are still responsive. This process is called health monitoring.

 

image

 

Ping Maximum Response Time: This will increase the waiting time of a Ping request, IIS will wait for.

Maximum time that a worker process is given to respond to a health monitoring ping. If the worker process does not respond, it is terminated.

Above two settings make sure that IIS is aware of the current state of the worker process. Hence, above settings can be manipulated as per application performance but should not be disabled completely in production environments.

 Note: These settings should not be changed in Production environment.

Why these settings should not be changed:
These settings are meant for health monitoring, reporting and to enable the WAS process to kill/restart the worker process whenever this is unhealthy. Whenever worker process is not healthy, this should be killed and also reported. If you disable this ping feature or increase this response time, requests will be waiting for the process to come responsive and your website performance will be hit.

 

References:

http://msdn.microsoft.com/en-us/library/bb763108.aspx

http://technet.microsoft.com/en-us/library/cc725836(v=ws.10).aspx

http://blogs.msdn.com/b/webdevelopertips/archive/2009/03/30/tip-48-did-you-know-that-iis7-application-pool-s-ping-settings-may-affect-iis7-based-website-or-application-debugging.aspx

http://blogs.msdn.com/b/jjameson/archive/2010/04/21/disable-pinging-of-your-application-pool-worker-process-in-iis.aspx

Please let me know if you have any questions.

Thanks

Gaurav

Comments (2)

  1. Bon says:

    Please can you elaborate the reason for: Note: These settings should not be changed in Production environment. ???

  2. Bon,

    Apologize for the late response. I have edited the blog to explain the reasons. Please let me know if you have any further questions regarding this.

    Thanks

    Gaurav

Skip to main content