查w3wp属于哪个程序池

来源:互联网 发布:80端口什么服务可以用 编辑:程序博客网 时间:2024/04/27 15:33

What Application Pool does this W3WP.EXE belong to?

Published 22 February 06 04:58 AM | jamesbl 

During the course of working through issues, I get asked at least twice a week how to determine which application pool maps to a particular worker process PID (Process ID) on a server.  I suppose there are lots of ways to determine this, but here two that come to mind to determine the answer.

The first way, and by far the easiest, is to use one of the new scripts that come in the box called IISAPP.VBS.  It is located in the %SystemRoot%/system32 directory.  For example:

C:/WINDOWS/system32>cscript iisapp.vbs
Microsoft (R) Windows Script Host Version 5.6
Copyright (C) Microsoft Corporation 1996-2001. All rights reserved.

W3WP.exe PID: 1172 AppPoolId: StsAdminAppPool
W3WP.exe PID: 2656 AppPoolId: MSSharePointAppPool
W3WP.exe PID: 2148 AppPoolId: WMS App Pool
W3WP.exe PID: 3604 AppPoolId: defaultwebsite

As you can see, this script makes it very easy to determine what the PID is of each specific Application Pool.  This is nice to use when trying to determine which PID you may want to snap a dump of for debugging purposes.

There are others that are cool as well.  For more details on the various other scripts that are also included, see this link.  I also encourage you to open a command prompt, navigate to your system32 directory on your IIS6 machine then run a "dir iis*.vbs" command and check out the new scripts.

The second way is a bit more obscure and requires that you run the tlist.exe command, which comes with the Debugging Tools for Windows.  Here is an example of that, which is fairly interesting:

C:/Program Files/Debugging Tools for Windows>tlist -v
0 1172 w3wp.exe
Command Line: c:/WINDOWS/system32/inetsrv/w3wp.exe -a //./pipe/iisipmec19a7d8-c08d-42f4-b2c9-69d7cfe28c74 -ap "StsAdminAppPool"
0 2656 w3wp.exe
Command Line: c:/WINDOWS/system32/inetsrv/w3wp.exe -a //./pipe/iisipm4bc52071-9ebb-4e39-9ba5-b256b4be4014 -t 20 -ap "MSSharePointAppPool"
0 2148 w3wp.exe
Command Line: c:/WINDOWS/system32/inetsrv/w3wp.exe -a //./pipe/iisipmfa132134-c1ed-47d4-be52-417ce5a59e63 -t 20 -ap "WMS App Pool"
0 3604 w3wp.exe Title: OLEChannelWnd
Command Line: c:/WINDOWS/system32/inetsrv/w3wp.exe -a //./pipe/iisipmdd93382a-645a-467c-bdbd-07c3ad6833a4 -t 20 -ap "defaultwebsite"

Note:  I snipped all other processes and only left the 4 W3WP.EXE processes that we're interested in.

If you look carefully above, you will see the name of the Application Pool specified directly on the command line for W3WP.EXE!  You mean you can call this thing directly?  Interestingly enough, there are documented command line options for it.  Interesting?  No?  Bonus points if you can tell me why the last application pool has a Title of "OLEChannelWnd" :)

For those interested parties still left reading, here are the command line options for W3WP.EXE that are documented via -?:

C:/WIN2003/system32/inetsrv>w3wp -?
Usage: w3wp [options]
 
        -debug
                 This option is required for launching from the command line.
                 If not provided the app pool name, default url, and site id
                 will be defaulted to
                         AppPoolName = StandAloneAppPool
                         URL list    = http://*:80/:80/:80/
                         Site Id     = 1
 
        -ap <Application Pool Name>
                 Indicates the application pool name
                 that will queue requests for the
                 worker process.  No other worker processes
                 with this name can be running at the
                 same time as this one
 
        -d <URL List>
                 Indicates the urls to listen to.
                 Examples:les:
                         http://*:80/:80/
                         http://HostString:80/
                         http://111.11.111.11:80:111.11.111.11/
                         http://HostString:80:111.11.111.11/
 
        -s <#>
                 Which site are the urls provided associated with.
                 The site number is used to access data from the metabase
                 for processing the requests.sts.

 

Good night...for now.

Filed under: IIS
http://blogs.msdn.com/jb/archive/2006/02/22/536693.aspx
在system32目录下查找dir iis*.vbs 可以看到有很多脚本。
iisweb /query可以查询各网站的信息。
在2003系统IIS6下,经常出现w3wp.exe的内存占用不能及时释放和CPU占用居高不下的问题,从而导致服务器响应速度很慢。怎样才能找出是哪一个站点出问题呢?
 
首先给每个站点都建一个应用程序池,这样便于找出问题出在哪一个站点上!
 
接下来就简单了
 
1、在任务管理器中增加显示pid字段。就可以看到占用内存或者cpu最高的进程pid!
 
2、在命令提示符下运行iisapp -a。注意,第一次运行,会提示什么“此脚本不能与 wscript 工作”,点击确定,接着会弹出一个对话框,是英文的,应该是提示你装一个什么来着,忘了,没关系,点确定就可以了。然后再次运行iisapp -a就可以了。这样就可以看到pid对应的应用程序池的名称了!
 
3、到iis中察看该应用程序池对应的网站,就可以了!然后真对站点排除错误!
(顺便说一下,如果运行后出现 error - no no results 这样的提示,说明你的站点没有开启或还没有被访问过!)
 
 
下面详细介绍一下 iisapp 的语法!
语法
iisapp [a/ AppPoolName | /p AppPoolID]

参数
/a AppPoolName

指定特定应用程序池的名称。(可选项)

/p AppPoolID

按 ID 号指定应用程序池。(可选项)

注释
• 如果未指定应用程序池名或 ID, 则 iisapp 列出所有运行应用程序。 
 
• 仅当使用 /s 时,才可使用 /u 和 /p 命令行选项。必须同时使用 /p 和 /u 才能提供用户密码。
 
• Iisext.vbs 执行 IIS 管理器中可用的相同操作。可使用任何一种工具管理 IIS 网站。
 
• 发出命令的计算机必须正在运行 Windows XP 或 Windows Server 2003 操作系统。用户必须是命令所影响的计算机上的 Administrators 组成员。
 
• 命令所影响的计算机必须是运行带有 Internet 信息服务 (IIS) 6.0 的 Windows Server 2003 的服务器
原创粉丝点击