Mar 9 2010
IIS 7.0 and WAS : A Primer
Continue to my previous introductory post about AppFabric, it is very fundamental to know the architecture IIS 7.0 and WAS. So, this post.
In the above diagram, you can see two regions in Windows. The kernal mode and user mode, and you know that processes in the kernal mode touches the CPU and other hardwares without any interface and have the rights to access physical memory without any virtual address mapping. The user mode processes are our own applications along with Windowing Subsystem which also includes Windows Network Subsystem. Processes in the user mode requires processes in the kernal mode such as thread scheduling, memory, cache or IO related activities. So, it would require a thread context switching means that kernal model thread has been created and the data in the user mode thread has been transferred into kernal mode thread. Ahhh, I’m explaining too much about Windows processing. Lets cut off.
IIS 7 Components
Application Pool and Worker Process
Worker process is a windows process which is specifically designed for hosting and running static, ASP or ASP.NET web applications in IIS. w3wp.exe is responsible for loading the appropriate ISAPI (a lower level programming module for handling specific web application, for example aspnet_isapi.dll for ASP.NET) filters and starts a new worker process for a request.
Application pool is a grouping of web applications those are routed to one or more worker processes. Processes in one application pool will not be impacted by another application pool’s failure.
Request Processing Pipeline and Modules
A request processing pipeline is created for every request. In the previous versions of IIS, if a request is for ASP.NET application, the application needs to exit from the IIS pipeline and load aspnet_isapi for handling ASP.NET code which inturn creates its own request processing pipeline. In II7, both IIS and ASP.NET request pipelines are combined and called as “Integrated Pipeline“. This pipeline contains one or more modules. Module is a component which contain a specific set of features for IIS to handle a request. For example, BasicAuthenticationModule is a module for performing basic authentication and FileCacheModule is a module for caching files and file handles.
The integrated pipeline has following benefits:
- Eliminating the duplication of features between IIS and ASP.NET, for example authentication
- One inventory for all IIS modules
- Performance…performance…
WWW Service and WAS
It is necessary that a dedicated component is required for listening for requests and managing application pools and worker processes. In IIS 7, WAS (Windows Process Activation Service) is dedicated for this. Requests coming from different transports like HTTP, TCP/IP, NetPipe and MSMQ are handled by respective listener adapters configured in the WAS. When a request is coming which is directed to respective listerner adapters which passes the request to appropriate worker process, where the application manager directs the request to the specific application.
WWW Service (World wide web publishing service, simply w3svc) is the listener adapter for HTTP. Apart from this, it manages the configuration stuffs required for HTTP related.
Protocol Listeners and HTTP.sys (Kernal Mode)
As its name reflects, protocols listeners receive appropriate requests and passes them to the IIS. Note that protocol listener are kernal mode processes. This model allows to handle any protocol, and the only thing we require is appropriate device drive as like as HTTP.sys for HTTP requests.
Whenever a HTTP request is entering into the server, HTTP.sys receives the requests and pass it to appropriate worker process if exists, otherwise it puts the request in the request queue. When a response for a request is already in the response cache, it fetches that and reply it back without noticing and invoking worker process.
Dan
Dec 17, 2010 @ 02:40:50
Do you know if there is a way to use IIS7 and WAS to direct connections to a non WCF service? Or maybe a WCF Service but without the client knowing anything about WCF data contracts?
For example, I have a service that takes a TCP connection and does stuff with the TCPClient stream. I’d like to use IIS7 to manage the connections and IP filtering. Is that possible? I need to be able to connect to my service using Hyper Terminal TCP connection.
Is that possible?
udooz
Dec 19, 2010 @ 17:21:51
Hi Dan,
No luck (as of my knowledge) for this. Instead you can create WCF service with non-HTTP binding which still be interoperable to non-WCF and non-.NET client too.
Regards,
Udooz.
vstarmanv
Dec 24, 2010 @ 14:21:09
awesome!!
thanks for good information…
now I can a little understand WAS and IIS architecture.
may i use that image?
i want to record this image to my blog by explaining WAS.
udooz
Dec 28, 2010 @ 21:46:10
Sure you can, please put a reference link to this post.