Introduction
This article describes how the IIS process client’s requests and responses.
When request come from client to the server a lot of operation is performed before sending response to the client. This is all about how IIS Process the request. Here, this article is all about the operation of IIS Level. Before we start with the actual details, we should start from the beginning so that we can understand its concept easily.
What is Web Server?
When we run our ASP.NET Web Application from visual studio (VS) IDE, VS Integrated ASP.NET Engine is responsible to execute all kind of asp.net requests and responses. The process name is “WebDev.WebServer.Exe” which actually takes care of all request and response of a web application which is running from Visual Studio IDE.
Now, the name “Web Server” come into the role when we want to host or publish the application on a centralized location and wanted to access from many locations. Web server is responsible for handle all the requests that are coming from clients, process them and provide the responses.
What is IIS ?
IIS (Internet Information Server) is one of the most powerful web server’s tools from Microsoft that is used to host your ASP.NET Web application. IIS has its own ASP.NET Process Engine to handle the ASP.NET request. So, when a request comes from client to server, IIS takes that request and process it and send response back to clients.
Request Processing:
Now it’s clear that what is Web server, IIS and what is the use of them. Now let’s have a look how they do things internally. Before we move ahead, we have to know about two main features of IIS.
1. Worker Process
2. Application Pool
Worker Process: Worker Process (w3wp.exe) runs the ASP.Net application in IIS. This process is responsible to manage all the request and response that are coming from client system. All the ASP.Net functionality runs under the scope of worker process. When a request comes to the server from a client worker process is responsible to generate the request and response. In other words, we can say worker process is the heart of ASP.NET Web Application which runs on IIS.
Application Pool: Application pool is the container of worker process. Application pool is used to separate sets of IIS worker processes that share the same configuration. Application pool enables a better security, reliability, and availability for any web application. The worker process serves as the process boundary that separates each application pool so that when one worker process or application is having an issue or recycles, other applications or worker processes are not affected. This will make sure that a particular web application doesn’t not impact other web application as they are configured into different application pools.
Application Pool with multiple worker process is called “Web Garden”.
Now, we have covered all the basic concept like Web server, Application Pool, Worker process. Now let’s see how IIS process the request when a new request comes up from client.
If we look into the IIS 6.0 Architecture, we can divided them into Two Layers
1. Kernel Mode
2. User Mode
Now, Kernel mode is introduced with IIS 6.0, which contains the HTTP.SYS. So whenever a request comes from Client to Server, it will hit HTTP.SYS First.
Now, HTTP.SYS is Responsible for pass the request to particular Application pool. Now one question comes in our mind, How HTTP.SYS comes to know where to send the request? This is not a random pickup. Whenever we create a new Application Pool, the ID of the Application Pool is being generated and it’s registered with the HTTP.SYS. So whenever HTTP.SYS Received the request from any web application, it checks for the Application Pool and based on the application pool it send the request.
So, this was the first steps of IIS Request Processing.
Till now, Client Requested for some information and request came to the Kernel level of IIS means at HTTP.SYS. HTTP.SYS has been identified the name of the application pool where to send. Now, let’s see how this request moves from HTTP.SYS to Application Pool.
In User Level of IIS, we have Web Admin Services (WAS) which takes the request from HTTP.SYS and pass it to the respective application pool.
So, this was the first steps of IIS Request Processing.
Till now, Client Requested for some information and request came to the Kernel level of IIS means at HTTP.SYS. HTTP.SYS has been identified the name of the application pool where to send. Now, let’s see how this request moves from HTTP.SYS to Application Pool.
In User Level of IIS, we have Web Admin Services (WAS) which takes the request from HTTP.SYS and pass it to the respective application pool.
When Application pool receives the request, it simply passes the request to worker process (w3wp.exe). The worker process “w3wp.exe” looks up the URL of the request in order to load the correct ISAPI extension. ISAPI extensions are the IIS way to handle requests for different resources. Once ASP.NET is installed, it installs its own ISAPI extension (aspnet_isapi.dll) and adds the mapping into IIS.
Note: Sometimes if we install IIS after installing asp.net, we need to register the extension with IIS using aspnet_regiis command.
When Worker process loads the aspnet_isapi.dll, it starts an HTTPRuntime, which is the entry point of an application. HTTPRuntime is a class which calls the ProcessRequest method to start Processing.
When this methods called, a new instance of HTTPContext is been created. Which is accessible using HTTPContext.Current Properties? This object still remains alive during life time of object request. Using HttpContext.Current we can access some other objects like Request, Response, and Session etc.
After that HttpRuntime load an HttpApplication object with the help of HttpApplicationFactory class. Each and every request should pass through the corresponding HTTPModule to reach to HTTPHandler, this list of module are configured by the HTTPApplication.
Now, the concept comes called “HTTPPipeline”. It is called a pipeline because it contains a set of HttpModules ( For Both Web.config and Machine.config level) that intercept the request on its way to the HttpHandler. HTTPModules are classes that have access to the incoming request. We can also create our own HTTPModule if we need to handle anything during upcoming request and response.
HTTP Handlers are the endpointsin the HTTP pipeline. All request that are passing through the HTTPModule should reached to HTTPHandler. Then HTTP Handler generates the output for the requested resource. So, when we requesting for any aspx web pages, it returns the corresponding HTML output.
All the request now passes from httpModule to respective HTTPHandler then method and the ASP.NET Page life cycle starts. This ends the IIS Request processing and starts the ASP.NET Page Lifecycle.
Conclusion
When client request for some information from a web server, request first reaches to HTTP.SYS of IIS. HTTP.SYS then sends the request to respective Application Pool. Application Pool then forward the request to worker process to load the ISAPI Extension which will create an HTTPRuntime Object to Process the request via HTTPModule and HTTPHanlder. After that the ASP.NET Page LifeCycle events start
I every time used to study piece of writing in news papers but now as I am a user of net therefore from
now I am using net for posts, thanks to web.
I’m really impressed with your writing skills as well as with the layout on your blog.
Is this a paid theme or did you customize it
yourself? Anyway keep up the nice quality writing, it is rare to see a great blog like this one
nowadays.
Its free theme. Thanks for your comment.
Very soon this website will be famous amid all blogging
and site-building users, due to it’s nice content
This is my first time go to see at here and i am truly pleassant to read everthing at single place.
It’s remarkable for me to have a web page, which is good designed for my experience.
thanks admin
Thanks , I have recently been looking for info about this topic for a long
time and yours is the best I’ve came upon so far. But,
what concerning the conclusion? Are you certain about the supply?
I really like your blog.. very nice colors & theme. Did you create
this website yourself or did you hire someone to do it for
you? Plz respond as I’m looking to design my own blog and would like to know where u got this from.
thanks a lot
I have created this blog myself. I have not hired anyone for this blog.
whoah this weblog is fantastic i really like reading your posts.
Keep up the great work! You know, lots of persons are searching round
for this information, you can help them greatly.
I am really enjoying the theme/design of your web site.
Do you ever run into any internet browser compatibility problems?
A handful of my blog visitors have complained about my website not working correctly
in Explorer but looks great in Opera. Do you have any tips to help fix this issue?
I dont have any tips regarding your issue.
You should take part in a contest for one of the most useful websites
online. I most certainly will highly recommend this web
site!
Hmm is anyone else having problems with the pictures on this blog loading?
I’m trying to determine if its a problem on my end or
if it’s the blog. Any responses would be greatly appreciated.
Oh my goodness! Incredible article dude! Thank you
so much, However I am having troubles with your RSS. I don’t know why I cannot subscribe to it.
Is there anyone else getting similar RSS issues? Anyone that knows the solution will
you kindly respond? Thanx!!
Thanks for comment. Many of us are getting blog through RSS, I can not say, why you are not getting.
I’m amazed, I have to admit. Rarely do I come across a
blog that’s both equally educative and amusing, and without
a doubt, you’ve hit the nail on the head. The problem is something that too few men and women are speaking intelligently about.
I am very happy I found this in my hunt for something concerning this.
Awesome post.
Link exchange is nothing else but it is just placing the other person’s
webpage link on your page at proper place and other person will also do same in favor of you.
Hello! Someone in my Myspace group shared this site
with us so I came to take a look. I’m definitely loving
the information. I’m book-marking and will be tweeting
this to my followers! Wonderful blog and superb design.
I every time used to read piece of writing in news papers but now as I am
a user of web thus from now I am using net for articles, thanks to web.
Hi there mates, its impressive piece of writing
concerning educationand fully explained, keep it
up all the time.
Greetings from California! I’m bored at work so I decided to browse your
site on my iphone during lunch break. I really like the info you provide
here and can’t wait to take a look when I get home.
I’m surprised at how quick your blog loaded on my phone ..
I’m not even using WIFI, just 3G .. Anyways, superb blog!
Greetings I am so glad I found your web site, I really found you by mistake,
while I was looking on Google for something else, Regardless I
am here now and would just like to say kudos for
a incredible post and a all round exciting blog (I also love the theme/design),
I don’t have time to go through it all at the minute but I have
book-marked it and also added in your RSS feeds, so when I have time I will
be back to read a lot more, Please do keep up the great work.
I read this paragraph completely about the difference of most recent and preceding technologies,
it’s awesome article.
I could not resist commenting. Exceptionally well written!
I’d like to thank you for the efforts you have
put in penning this website. I am hoping to check out the
same high-grade content from you later on as well.
In truth, your creative writing abilities has encouraged me
to get my very own site now 😉
Thanks and create your own site now 🙂
An interesting discussion is definitely worth comment.
I do think that you should write more about this subject,
it may not be a taboo matter but typically folks don’t speak about such issues.
To the next! Kind regards!!
Hello, I enjoy reading through your post. I wanted to write a little comment to support you.
These are truly great ideas in concerning blogging.
You have touched some nice points here. Any way keep up
wrinting.
What’s Happening i’m new to this, I stumbled upon this I
have found It positively useful and it has helped me out loads.
I hope to contribute & assist other customers
like its aided me. Great job.
Thanks.
Incredible quest there. What occurred after?
Take care!
wonderful put up, very informative. I wonder why the other experts
of this sector don’t realize this. You must continue
your writing. I am confident, you’ve a huge readers’ base already!
Hey there! I just wanted to ask if you ever have any
trouble with hackers? My last blog (wordpress) was hacked and I ended up losing
many months of hard work due to no back up.
Do you have any methods to prevent hackers?
No, I have not suffered this type of problem yet. Password should be very secure.
I relish, cause I discovered just what I was looking for.
You’ve ended my four day long hunt! God Bless you man. Have a great
day. Bye
Excellent blog you have got here.. It’s hard to find high
quality writing like yours nowadays. I truly appreciate individuals like you!
Take care!!
Incredible! This blog looks just like my old one! It’s on a completely different subject but it has pretty much
the same page layout and design. Wonderful choice of colors!
continuously i used to read smaller articles or reviews which also
clear their motive, and that is also happening with
this article which I am reading here.
Currently it sounds like WordPress is the best blogging
platform out there right now. (from what I’ve read) Is that what you are using on your
blog?
Yes, I am also using wordpress as blog platform.
For the reason that the admin of this web site is working, no uncertainty very rapidly
it will be famous, due to its feature contents.
I loved as much as you’ll receive carried out right here.
The sketch is attractive, your authored material stylish.
nonetheless, you command get bought an impatience over that
you wish be delivering the following. unwell unquestionably come further formerly again as exactly
the same nearly a lot often inside case you shield this increase.
Hi friends, nice piece of writing and good urging commented at this place, I am in fact enjoying by these.
Hey there, You have done a great job. I’ll certainly digg it and personally suggest
to my friends. I am sure they’ll be benefited from
this website.