IIS Memory Management (Part 3)

…am back again to write about the way Application Logic functions in the Application Services Layer Middle-Tier in a 3-Tier Architecture. J

Role of IIS in Application Layer and IIS 6.0 Architecture - An overview...

My previous blog was about the 3-Tier Architecture in a brief thought process. My vision now is to let you know specifically the role of IIS in the Application Layer (the middle-tier). In simple words, IIS plays the role as a medium between the User Interface and the Application Logic which in-turn redirects the client requests to the concerned application service that resides on the application server. But, was that actually “in simple words”?? ...I guess not..!! J

Let me try to be more precise to detail about the role of IIS in Application Layer and share a simple diagram (a rough paint of mine)… J

 

3-Tier Architecture

 

 

 

 

 

 

                     

 

Time to recollect the 3-tier architecture discussed in my prev blog and to relate it with the diagram above (and ofcourse, my imaginary domain name (techdumbo.com))... :-)

Typically, to relate on a practical note, you may consider that an end-user is keying in the URL (http://www.techdumbo.com) in his browser window (Internet Explorer). User level forms / the default pages on that website get processed immediately in the Presentation Layer. He is then displayed with a series of forms where-in he could select the kind of data he requires. He selects the data criteria and submits the form. This request is then processed through ASP pages to (black arrow) the Business Logic. Application Service in this layer now analyzes the data criteria selected by the end-user, processes it to the Data Layer using the connection providers, specifically to the SQL Database Engine. Data Layer then verifies / authenticates / validates the criteria and sends back the data to (white arrow) the Presentation Layer.

So… here is the key!! How the application specific ASPX pages are are displayed in end-users browser window? As soon the user key-in http://www.techdumbo.com, the DNS client service is initiated and the client request to this URL is redirected to the DNS server in that particular client site. DNS server then checks for the domain name techdumbo.com and find appropriate host record matching www.techdumbo.com, fetch the related IP address to that host record, and forward the client request to the Web Server that holds the same IP address. This Web Server is nothing but an Application Server with Windows 2003, IIS component and the Application Service installed and configured in it. Thus, the client browser fetches the Default Document from the Web Server.

Default Document?? …now… what does it mean in IIS context? Maybe it still needs clarity for beginners. Fine! Logon to the IIS console (start – run – inetmgr.exe), then right-click on the Default Web Site properties, go to Documents tab. Here is what we map the website URL to a default document that an administrator could add manually, which usually becomes default.aspx / index.aspx / or so on… depends on the Application Development process. By configuring default.aspx as the default document in this tab for instance, when an end-user hits the URL http://www.techdumbo.com, in-turn the IIS server sends him the default.aspx to the client browser, that is, Internet Explorer window. Hope this helps! J

This process is just fine and we understand how IIS helps an end-user as an interface component to serve the web pages being in Application Layer. However, it is a must to understand the concept of Application Pool in IIS 6.0. Yes! It is time to write about IIS 6.0 Architecture. J

IIS 6.0 Architecture – An overview…

The basic difference between IIS 5.0 and IIS 6.0 lies primarily on the way application service is isolated from IIS services. IIS 6.0 is based on the concept of Worker Process mode for Application Isolation. When I say Worker Process, you could imagine a process named w3wp.exe in Task Manager that could be noticed on the same IIS server box configured in IIS 6.0 Worker Process mode. This is nothing but an IIS Application Pool process which takes accountability on executing the Application Logic scripts on the IIS Server. To recollect precisely, we still can have multiple websites created on the same IIS 6.0 console. This means, each website can be mapped to a specific application pool on the IIS console. To help you understand better, go to start – run – inetmgr.exe. Here in the IIS console, you will find Default Web Site listed automatically. And, you will also find Default Application Pool listed just above the website hive. Right-click on the Default Web Site and click on Properties. Here in Home Directory tab, you will find that the website is mapped to Default App Pool.

This way, the application (documents that you might find in the path specified in home directory tab) which is configured to execute on this specific website will be using Default App Pool. In-turn, we can be more specific by stating that the application uses the memory space as utilized by the w3wp.exe process in Windows. As many application pools you create, that many w3wp.exe is found in Task Manager, which again means, that many Isolated Memory Space is created for each application hosted on the same IIS 6.0 web server.

However, you should also remember that the term Isolation does not mean isolating just the applications hosted on the IIS server. The key point here is about isolating the applications from IIS services. Yes! IIS Service primarily runs on inetinfo.exe (this could also be found in the Task Manager). This service takes effect as soon as the IIS Admin Service is started in services.msc, which initiates the metabase configuration to be effective on the current IIS component installation.  

Metabase? Now, what does this mean? In simple terms, this is just like how Registry acts for Windows OS; Metabase acts for IIS component in Windows OS. IIS uses the metabase as soon as the IIS Admin Service is initialized and sets the configuration accordingly as specified in the metabase. In IIS 6.0, you will be able to find the metabase in %systemroot%\System32\Inetsrv\Metabase.xml.

Having said about metabase, you could imagine the importance of inetinfo.exe process which handles the IIS Admin Service / SMTP / FTP / NNTP. If Inetinfo.exe crashes, then it impacts on all these services too. To prevent and secure this specific process from sharing memory space with w3wp.exe (the application pool), IIS 6.0, by design, uses the Application Pool technology and segregates the applications hosted from IIS services. Hence, if there is an impact due to any reason against w3wp.exe in IIS 6.0, it affects ONLY that specific application hosted on the IIS web server, whereas, the other applications which are hosted and using other w3wp.exe processes and inetinfo.exe process continue to be with the same functionality. This can be simplified by the term IIS Isolation Mode. Hope this helps you to understand the concept better! J

With this explanation in mind, take a look at the diagrammatic representation as shared by the Microsoft Technet team and do refer to the technet link for an in-depth details on IIS 6.0 Architecture:

IIS 6.0 Architecture

 

 

 

 

 

 

 

 

 

 

 

Reference: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/93ddbb51-5826-4ebd-a434-24c5fd103d3a.mspx?mfr=true

...but, is there any other mode that IIS 6.0 supports? Yes! It is IIS 5.0 Isolation Mode.  This mode is used in-order to provide compatible platform for those scripts which are still dependent on IIS 5.0 design. This feature is more about providing backward compatibility to those scripts / applications which still depends on IIS 5.0 architecture. However, when we tend to migrate to the latest version of IIS, we always can count on to avail the best of its feature, that is, IIS Application Isolation Worker Process Mode. You could find this option by right-clicking on the root hive in IIS 6.0 console and click on Properties.

I believe this info to be sufficient for the time being. Let me share more about the design behind these processes to execute in User Mode and Kernel Mode Memory space, more specifically, what exactly do we mean by User Mode and Kernel Mode memory space and how these are related to the applications hosted on a web server with the physical memory configured on the server hardware?...in my successive blogs. J

As always… should you have a thought to share, pls click here. :-)

Cheers,                                                                                                                                                                                                                                        

Siva

2 Comments

Comments have been disabled for this content.