Event ID 2262

Event ID 2262

Postby yo-man » Fri Jan 05, 2007 9:57 am

I get this error many times on my server.  User are complaining about slow running.

   Event Type:     Warning
   Event Source:   W3SVC-WP
   Event Category: None
   Event ID:       2262
   Date:           1/4/2007
   Time:           9:22:03 AM
   User:           N/A
   Computer:      srv2k3web
   Description:
      ISAPI 'C:\Windows\Microsoft.net\Framework\v.1.1.4322\aspnet_isapi.dll' reported itself as
      unhealthy for the following reason: 'Deadlock detected'.

this one to

  Event Type:    Warning
  Event Source:  W3SVC
  Event Category: None
  Event ID:      1013
  Date:          1/4/2007
  Time:          11:28:47 PM
  User:          N/A
  Computer:      srv2k3web
  Description:
      A process serving application pool 'DefaultAppPool' exceeded time limits during shut down.
      The process id was '4736'.


How to fix this?  Server not running good, many complains.

Last edited by yo-man on Fri Jan 05, 2007 2:14 pm, edited 1 time in total.
yo-man
Newbie
Newbie
 
Posts: 2
Joined: Fri Jan 05, 2007 9:53 am

Re: Event ID 2262

Postby Darwin » Fri Jan 05, 2007 1:42 pm

This problem might occur because ASP.NET limits the number of worker threads and completion port threads that a call can use to execute requests.

Typically, a call to a Web service uses one worker thread to execute the code that sends the request and one completion port thread to receive the callback from the Web service. However, if the request is redirected or requires authentication, the call may use as many as two worker and two completion port threads. Therefore, you can exhaust the managed ThreadPool when multiple Web service calls occur at the same time.

For example, suppose that the ThreadPool is limited to 10 worker threads, and all 10 worker threads are currently executing code that is waiting for a callback to execute. The callback can never execute because any work items that are queued to the ThreadPool are blocked until a thread becomes available.

Another potential source of contention is the maxconnection parameter that the System.Net namespace uses to limit the number of connections. Generally, this limit works as expected. However, if many applications try to make many requests to a single IP address at the same time, threads may have to wait for an available connection.

To resolve these problems, you can tune the following parameters in your Machine.config file to best fit your situation:
maxWorkerThreads and maxIoThreads
ASP.NET uses the following two configuration settings to limit the maximum number of worker threads and completion threads that are used:

minFreeThreads and minLocalRequestFreeThreads
ASP.NET also contains the following configuration settings that determine how many worker threads and completion port threads must be available to start a remote request or a local request:

maxconnection
The maxconnection parameter determines how many connections can be made to a specific IP address. The parameter appears as follows:
   
   

The settings for the parameters that are discussed earlier in this article are all at the process level. However, the maxconnection parameter setting applies to the AppDomain level. By default, because this setting applies to the AppDomain level, you can create a maximum of two connections to a specific IP address from each AppDomain in your process.

Recommendations
The settings that are recommended in this section may not work for all applications. However, the following additional information may help you to make the appropriate adjustments.

If you are making one Web service call to a single IP address from each ASPX page, Microsoft recommends that you use the following configuration settings:

• Set the values of the maxWorkerThreads parameter and the maxIoThreads parameter to 100.
• Set the value of the maxconnection parameter to 12*N (where N is the number of CPUs that you have).
• Set the values of the minFreeThreads parameter to 88*N and the minLocalRequestFreeThreads parameter to76*N.
• Set the value of minWorkerThreads to 50. Remember, minWorkerThreads is not in the configuration file by default. You must add it.


Some of these recommendations involve a simple formula that involves the number of CPUs on a server. The variable that represents the number of CPUs in the formulas is N. For these settings, if you have hyperthreading enabled, you must use the number of logical CPUs instead of the number of physical CPUs. For example, if you have a four-processor server with hyperthreading enabled, then the value of N in the formulas will be 8 instead of 4.

Note When you use this configuration, you can execute a maximum of 12 ASP.NET requests per CPU at the same time because 100-88=12. Therefore, at least 88*N worker threads and 88*N completion port threads are available for other uses (such as for the Web service callbacks).
Last edited by Darwin on Fri Jan 05, 2007 1:48 pm, edited 1 time in total.
Darwin
User avatar
Darwin
Full Member
Full Member
 
Posts: 111
Joined: Mon Oct 09, 2006 11:16 am
Location: Bradenton, FL

Re: Event ID 2262

Postby FreakShow » Fri Jan 05, 2007 1:50 pm

Generate dump files for diagnosis
IIS 6.0 has a new feature that is named Orphan Worker Process. This feature allows you to inspect a process that is scheduled to be recycled before the process is terminated. The Orphan Worker Process can be used to attach a debugger to the process and to generate a dump file for investigation.

Note This feature is not enabled when processes run in IIS 5.0 Compatibility mode.
Create a batch file to execute when a worker process is orphaned
1. Start Notepad
2. Paste the following code to Notepad:@if "%_echo%"=="" echo off
setlocal
    set TIMESTAMP=%DATE:~-9%_%TIME%
set TIMESTAMP=%TIMESTAMP:/=_%
set TIMESTAMP=%TIMESTAMP::=_%
set TIMESTAMP=%TIMESTAMP:.=_%
set TIMESTAMP=%TIMESTAMP: =_%
set FILENAME=c:\crash_%TIMESTAMP%.dmp
set LOG=c:\log.txt
set COMMAND=c:\debuggers\cdb.exe -c ".dump /o /mhf %FILENAME%;q" -p %1

echo %COMMAND% > %LOG%
%COMMAND%

endlocal

3. Save the file as FileName.cmd. For this example, we will name the file action.cmd. However, you may name the file as you want.
Note You may have to modify the location of the debuggers and the location that you want the resulting dump file to be generated.
Configure the orphan worker process settings
1. At the command prompt, type the following command, and then press ENTER:
cd \Inetpub\adminscripts
2. To enable the Orphan Worker Process feature, type the following command at the command prompt:adsutil.vbs SET W3SVC/AppPools/DefaultAppPool/OrphanWorkerProcess TRUE


3. At the command prompt, set the executable to run when a process is scheduled to be recycled. For example, in this case use the batch file that was created in the "Create a Batch File to Execute When a Worker Process Is Orphaned" section:adsutil.vbs SET W3SVC/AppPools/DefaultAppPool/OrphanActionExe "c:\action.cmd"
adsutil.vbs SET W3SVC/AppPools/DefaultAppPool/OrphanActionParams "%1%"


Note Make sure that the OrphanActionExe option points to the location of the batch file that was created in the "Create a Batch File to Execute When a Worker Process Is Orphaned" section. Also make sure that the identity of the W3wp.exe process has Read and Execute permissions to this file.
User avatar
FreakShow
Newbie
Newbie
 
Posts: 14
Joined: Tue Oct 10, 2006 2:22 pm

Re: Event ID 2262

Postby yo-man » Fri Jan 12, 2007 4:03 pm

follow microsoft guidelines run very bad, even worse.  change minFreeThreads to even lower --> 25,  Run much better now .
yo-man
Newbie
Newbie
 
Posts: 2
Joined: Fri Jan 05, 2007 9:53 am

Re: Event ID 2262

Postby Darwin » Fri Jan 12, 2007 4:15 pm

Keep tweaking the numbers till you get some acceptable performance, the MS guidelines dont work for every application, but are a good starting point.  Keep us posted on your progress.

Darwin
User avatar
Darwin
Full Member
Full Member
 
Posts: 111
Joined: Mon Oct 09, 2006 11:16 am
Location: Bradenton, FL


Return to Windows 2003 Server

Who is online

Users browsing this forum: No registered users and 0 guests

cron