quinta-feira, 17 de janeiro de 2013

Identificar Qual O Processo IIS W3wp.Exe Pertence A Qual Pool De Aplicativos No Iis7

Identificar Qual O Processo IIS W3wp.Exe Pertence A Qual Pool De Aplicativos No Iis7

 Se o Windows Task Manager mostra o uso excessivo de recursos (CPU ou memória, principalmente) para um processo de trabalho do IIS 7 (w3wp.exe), é útil para identificar qual dos pools de aplicativos consome os recursos. Eu não encontrei uma maneira de fazer isso no Gerenciador do IIS para que eu prosseguiu assim:

Se o  processo WAS, estiver parado inicie ele, no services ou no prompr de comando

No prompt de comando: net start WAS
 
Nota: WAS é o Windows Process Activation Service.
 
Executar appcmd list wp: %windir%/system32/inetsrv/appcmd list wp
Irá mostrar alguns processos como o abaixo.

WP "5716" (applicationPool: DefaultAppPool)
WP "968" (applicationPool: MyOtherAppPool)
WP "5836" (applicationPool: TheThirdAppPool)
 
O número no resultados é o processo de identificação dos processos do Windows ID (PID).
Agora no Windows Task Manager, depois de ter ativado a coluna PID em View> Select Columns ... você pode identificar o processo w3wp.exe pelo seu PID que está consumindo recursos do servidor.
 
imagem

 Se você tem uma maneira mais fácil de fazer isso, por favor poste nos comentários.
 
Fonte: http://dirk.net/2008/06/01/identify-which-w3wpexe-belongs-to-which-application-pool-in-iis7/



---------------------------------------------------------------------------------------------
Algumas informações a mais sobre o comentário do movmusica.
Mas só consegui localizar este arquivo no Windows 2003 Server (C:\WINDOWS\system32).

Listing Running Web Applications Using Iisapp.vbs (IIS 6.0)

You can use the command-line script iisapp.vbs, which is stored in systemroot\system32, to view any worker processes that are currently running. This command is often used for troubleshooting.
The computer issuing the command must be running Windows XP or a member of the Windows Server 2003 family. The computer that the command affects must be running a member of the Windows Server 2003 family with IIS 6.0.
  Important
You must be a member of the Administrators group on the local computer to run scripts and executables. As a security best practice, log on to your computer by using an account that is not in the Administrators group, and then use the runas command to run your script or executable as an administrator. At a command prompt, type runas /profile /User:MyComputer\Administratorcmd to open a command window with administrator rights and then type cscript.exeScriptName (include the script's full path and any parameters).
This topic includes the following information:
Syntax: The order in which you must type a command and any arguments and options that follow it.
Parameters: The values that are given to variables in the command.
Examples: Sample code and an explanation of the results.

Syntax

iisapp [/a AppPoolName | /p PID]

Parameters

/aAppPoolName
Optional. Specifies the name of a particular application pool.
/pPID
Optional. Specifies an application pool by its ID number.

Examples

Example 1:

The following command displays all of the application pools that are running on the local computer:
iisapp
In response, iisapp displays all of the currently running applications, identifying each application pool by its process ID (PID) and application pool ID (AppPoolID). Iisapp omits all of the optional parameters and accepts the default values.
W3wp.exe PID: 2232 AppPoolID: DefaultAppPool
W3wp.exe PID: 2608 AppPoolID: MyAppPool

Example 2:

Use the following command to view a specific application by entering its PID:
iisapp /p 2608
In response, iisapp displays the specified application.
W3wp.exe PID: 2608 AppPoolID: MyAppPool

Fonte: Microsoft
https://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/b8721f32-696b-4439-9140-7061933afa4b.mspx?mfr=true
Em portugues https://technet.microsoft.com/pt-br/Library/cc786056%28v=ws.10%29.aspx


Links diversos:
http://forums.iis.net/t/1159427.aspx?Can+Not+Find+IISAPP+VBS+for+IIS+7
http://www.hansbaumann.net/VerArticulo.aspx?idarticulo=6
http://stackoverflow.com/questions/14857004/start-myapppool-using-iisapp-vbs
 

2 comentários:

movmusica disse...

Basta digitar o comando IISAPP no prompt irá listar os ids dos polls

By Dalson Lima

Rodrigo Firmino disse...

Oi Dalson, acrescentei algumas informações sobre o IISAPP mas só achei ele no Windows 2003 (C:\WINDOWS\system32) no Windows 2008 ou 2012 não tem.