Monday, March 24, 2008

IIS Memory Management (Part 2)

Hello everybody, I am back again to continue blogging on this topic; IIS Memory Management and this time, it is about In-Process & Out-Process Application Mode in IIS & 3-Tier Architecture in Web Application Services. Yes, it is indeed important to understand the varied application modes in IIS and how it is related in 3-Tier Web Application Architecture, before we get into the actual Memory Management scenarios. :-)

As always, here we go with My Thoughts:

Application Mode:

IIS can be tuned in such-a-way that the application running on a webserver, could share the User Mode Memory space of the IIS service components. And, this configuration, which can be customized by an administrator on the IIS admin console, results as the Application Mode configured currently on that specific webserver; either In-Process or Out-Process. More specifically, you will find Application Mode configuration in the Home Directory tab of the website properties on the IIS Admin Console (inetmgr.exe)...

Did this explanation helps you to understand the exact meaning of IIS Application Mode? Hmm.. I guess not! :-( ...what is lagging behind in this definition? I am pretty sure that the explanation is valid. As a beginner, I would immediately think of certain questions raised in my mind from that of the above detail as listed below:


  • What is an Application?
  • Is IIS not an Application?
  • When user is browsing a website, is it not the IIS as an application serving their requests?
  • what is User Mode Memory?
  • what is Kernel Mode Memory?
  • What is In-Process?
  • What is Out-Process?
  • If my server has 4 GB of RAM, the physical memory, it is the Operating System which deals on the processes and the memory allocation for each process. So, why would IIS come into picture on the memory utilization?
  • Where exactly does this "application mode" helps in IIS Memory Management?
... Okay.. enough for now!! :-) ...

Let me now try to answer these thoughtful queries and help you understand the definition better.

Source:
http://technet.microsoft.com/en-us/library/bb727121.aspx

Reference: http://microsoft.apress.com/index.php?id=50

In a typical scenario, we have in most cases, three-tier architecture lay on the scope of any project design; the Presentation Layer which deals with the User Interface components, the Business Logic which deals with the Application & Webserver Components and the Data Layer which holds the actual data, typically on a database server.



This application server and IIS service (usually hosted on the same server hardware, depending on the load / traffic analysis, we also tend to split the design by having a separate server for IIS and the application) takes the user input from a client browser, sends the query data to the application server, and the application then establishes connectivity to the customer database, which is a database server, fetches the records, again returns the output on the client browser.

Still not clear about the above explanation…??? Okay, here we go with a bit in-depth… :-)

I believe it is for sure, going to be easy to understand this concept with a simple instance. Let us now think about a scenario as such, a list of Customer Contact Information, stored centrally in an organization and that can be retrieved from anywhere across the globe by the sales team. As soon an employee visits,
http://www.myURL.com/cust-contact.aspx website, we must think as what exactly happens and how the data is processed?

Presentation Layer (User Services):

Initially, the client browser locates (forget about DNS resolution for now, let us focus on IIS) the webserver which holds the ASPX pages. These client-side ASPX pages (cust-contact.aspx) will load client components and display a form to enter the criteria to search the entire customer database. User selects a Customer ID and clicks on Search. With this, we move on to the Business Logic (Application Layer) which is the Middle-Tier.

Application Layer (Business Services):

Based on the user input, the specific Customer ID, is the data which now Business Logic would be interested more about. To process the data to the data layer, the application server components might use a technology like, DAO / ADO / OLE DB, based on the product requirements and design, and establishes connectivity to the database server. Once the datasource is connected to the data access layer successfully, it then submits the query statements based on the programming modules from the application logic to customer database. The records are then retrieved from the customer database and again displayed on the client browser using HTTP port. Ofcourse, TCP ports might differ on the connectivity from Application Layer to the Data Layer. Whereas, between the client browser and the application web interface, most of the process takes place using HTTP modules, again, this process is totally based on the project requirements.

Data Access Layer (Data Services):

This initiates a process as soon the application logic starts the programming modules to establish connectivity with the customer database. It verifies the connection provider, the user / group authentication parameters, network path, database server instance and the database name. Once it confirms all these information, will then take the code submitted by the application layer which includes the user input (customer ID), and fetches the records from the customer database. Data is then returned to the Application Logic, which in-turn processes the data to the client browser.

Well, this concept about 3-tier architecture is fine! But, where do we get IIS as a stand-point on the entirety? Precisely, what is the role of IIS here in the above scenario?

Fine, let me now get into the specifics of IIS in the above scenario:

The Windows Server OS with IIS component installed in it, which stores all the ASPX pages can be termed as a Webserver. IIS plays an important role as part of Business Logic (Application Layer) by providing a virtual path for users to browse the ASPX pages hosted on the Application Server.


IIS is the webserver, which is part of the Application Layer, where-in we create a website (or, maybe the Default Web Site) in IIS admin console. Once created, we copy all the related ASPX pages (that includes the programming module of the application logic) to the path, that is shown in Home Directory tab of the website properties in IIS admin console (incase if it happens to be the Default Web Site, then the path by design in any IIS installation is C:\Inetpub\WWWRoot).

Again, on the same Application Layer, the source code modules which processes and establishes connectivity with the data layer, processes the client requests to the database and fetches the records from the database to the client browser, can be termed as the Application hosted on the webserver (in some cases, you might even find certain application related executable images (.exe files) in task manager which are part of the actual Application Logic by itself.

All these transaction happens on HTTP port, which means, the TCP Port 80 used by IIS to host a website by default. While browsing the website on a client browser, on the same client machine, when you execute netstat –a (or) netstat –n command using cmd.exe, you will find that your client IP (local IP) is using PORT 80 to connect to the remote website (foreign address). This TCP Port can be customized / changed based on the requirements from the Security Team in an organization, during the project design phase.

Thus, IIS and the term Application differ in the Application Layer.

Hope this abstract gives a practical note on IIS as a webserver! We started off with In-Process & Out-Process Application Modes and have come a long way till this level of understanding varied layers on a Web Services Architecture. It is always a suggestive approach to gain knowledge on the above concept, before we dig into the actuals of Application Modes, as such, these are unswervingly inter-related.

Well, I suggest now to wait for my next blog to know more about the way IIS and Application Logic functions in the Application Services Layer (Middle-Tier) in a 3-Tier Architecture.

Should you have a thought to share, post a comment. :-)

Cheers,

Siva

Saturday, March 22, 2008

IIS Memory Management (Part 1)

Reference: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/ad56540c-2323-4316-b981-7ebb70352baa.mspx?mfr=true

My thoughts:

Here we go, with a simple terminology Memory Management. Is it something simple in reality? I guess not! Memory Management in any product has its own significant approach on handling process threads and client requests. Process Threads? Okay... Let us not deviate to System Internals at the moment! :-) ...

...instead, allow me to rephrase it as IIS as a webserver has its own method of handling client requests! When we say Client Requests, it could mean a lot, such as, the load on the server, total number of sessions, total number of visits / pageviews, and so on! However, this area of Memory Management gets maximum importance as soon we think about dynamic websites.

Now, what is a dynamic website? Well, answer is not just "Websites with dynamic web content!". :-) ... On a practical note, a dynamic website is one which has an effectual usage of the server memory space, while serving client requests to fetch or process a data, (which in most cases designed as a third normal form; resulting in primary key - foreign key database architecture) based on the criteria opted by the end-user. In such a situation, to trigger this kind of data manipulation / processing / transaction that occurs on the server memory space, we use programming languages like ASP.NET.

This results in creating dynamic webpages where-in the webserver takes the complete load on an end-to-end scenario, which again means, memory utilization on the IIS processes, that is, inetinfo.exe / mtx.exe (IIS 4.0) / dllhost.exe (IIS 5.0) / w3wp.exe (IIS 6.0), as I have shared in my blog about IIS Version Comparison. This design on its entirety shall be termed as a dynamic website.

Hope you find this blog a good start on IIS Memory Management!

Watch out for my next blog- IIS Memory Management (Part 2) ... :-)

Cheers,

Siva

Friday, March 21, 2008

IIS 4.0 Architecture

Source: http://www.microsoft.com/technet/prodtechnol/WindowsServer2003/Library/IIS/93ddbb51-5826-4ebd-a434-24c5fd103d3a.mspx

My thoughts:

Again, I am gonna pick out the source information from Technet - which is indeed a great place to gather technical information. To speak about IIS architecture, we must first need to know the version stand-point. Though we have IIS 2.0, 3.0 - let me start with IIS 4.0 and touchbase on IIS 7.0, being honest with you, my basic knowledge span over from IIS 4.0. :-)

Before you proceed with this blog post, I recommend you to keep referring to my blog on IIS Version Comparison. This process will let you gather a high-level detail about the varied versions and their features, which in-turn, mapped to the terminologies that would be used from this posting onwards.

IIS 4.0:
Well, here is something very little which I would like to share on this version of IIS. It is confined to 32 BIT Architecture Model (did we have 64 BIT those days!?) and the Application Isolation Mode was mapped to MTX.EXE. Which means, your application mode, when configured as Out-Process Isolation, the User Mode Memory will be allocated on the executable image MTX.EXE. Whereas, the same MTX.EXE will not be in picture at all, incase if you go by configuring your application as an In-Process Isolation Mode. In such a situation, the application memory will be sharing the memory space with Inetinfo.exe, which is the back-end process for executing IIS Admin Service. If you refer to IIS 5.0 Architecture (an upcoming blog of mine), I guess you will then be able to visualize on MTX.EXE as compared with DLLHOST.EXE. Ofcourse, many other feature enhancements have been made on IIS 5.0! :-)


For beginners: You will be able to find inetinfo.exe in Start -> Run -> Services.msc -> Properties of IIS Admin Service. If IIS is successfully installed and configured on a Windows OS, you will also find inetinfo.exe as a process in Task Manager of that webserver.

Wanna know more about these terminologies; Out-Process Isolation Mode / In-Process Isolation Mode / User Mode / Kernel Mode Memory Space? Suggest you to wait for my next blog on this topic - IIS Memory Management. :-)

Cheers,

Siva

Thursday, March 20, 2008

IIS Version Comparison Chart

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

My thoughts:

We often tend to think specifically about a new feature in a product, as an enhancement against a new version released. Do you think if that is all about releasing a new version? Not really! Well, it is a must to think about feature and also the architecture with design-level changes, with variations on the product-specific system files, which would have been incorporated in the new version.

As many of us are aware of, IIS (Internet Information Service) indeed has come out with a drastic change in the way of handling applications conceptually and practically through In-Process and Out-Process technology.

BTW, What exactly do you mean by In-Process and Out-Process applications? To know about this concept with an in-depth architectural overview, please wait for my successive posts.

For now, I suggest you to take a look at the comparison chart on various IIS versions, as is shared by Microsoft Technet team, that gives you a high-level data on various versions of IIS and their feature specifications.

What I have shared above is just a screenshot of the chart. You may additionally refer to the source link I have mentioned above to gain a copy of the comparison chart from Technet and document it in your process on a need basis.

Let me know if you have a thought to share on this aspect. :-)

Cheers,

Siva