What's the relation between classic asp and a IIS application pool? - iis

Does asp run in the IIS application pool for which the website is configured? Or is the application pool only for asp.NET applications.
How do those two relate to each other, what do i need to know to understand who's doing what and where are they doing it...

An ASP Classic application will run in the application pool to which it is assigned.
ASP.NET application also run in their assigned application, hence its possible that one or more ASP.NET applications and one or more ASP applications will run in the same pool and therefore share process(es).
In IIS6 there is little relationship between the two (ASP and ASP.NET applications) they simply do their thing side-by-side. They share the same virtual memory space so if one is a hog the other is affected. Additionally if one crashes the process all other apps that are in the pool (ASP and/or ASP.NET) are affected. They also share a common ISAPI filter stack which runs on a per-process basis.
In IIS7 with the integrated pipeline things become, well, more integrated. ASP classic relies on the .NET based pipeline to deliver requests to handle.

Related

How to synchronize more than one IIS web servers

I have a .net web application, I want to host the app into more than one IIS web servers. The web servers must synchronized so if one web server is down than the others should respond to user requests.
Check out tools like:
gtg.dk
deploybot.com
Check out also deployplace it is very similar to DeployBot, but much more powerful and allows to deploy complicated application. It's still in beta, but there is a free plan.

Will deployment of web application that is under main site in IIS cause take down of the main site?

I have main website hosted in my IIS and under that I have multiple applications (another web apps) that run on a separate application pool. I know that if you will change some files of site that is hosted in IIS it will result into application pool recycling. However I am not sure what will happen in my scenario, from one hand they have different app pools, but from another hand application is hosted under main website.
Is it possible to deploy application that is hosted under web site without disrupting main site operation?
Thanks in advance.
No it wont. If you have your main site and applications running under different application pool, you should be fine.
Application Domains and application pool ensure isolation with respect to applications on IIS. Changes made to application will cause specific application domain to refresh and will not have an impact on other applications.

Will IIS recycle the asp.net core process?

I need to run long running background tasks in my asp.net core application.
I know of Azure Webjobs and other out of process techniques but I'd rather keep the solution simple and runs those tasks directly in the asp.net core process.
I use Kestrel and the application is hosted in IIS.
I understand that IIS will occasionally recycle the IIS process. Will it also recycle the asp.net core process?
Asp.Net Core < 2.2
Asp.net Core runs in a separate process dotnet.exe even when it is hosted in IIS. But it doesn't mean that it runs as an independent process. IIS still responsible for Asp.net core process (dotnet.exe) life cycle through the AspNetCoreModule.
So, answer is yes, IIS will also recycle the asp.net core process
Asp.Net Core >= 2.2
Asp.Net Core 2.2 has in-process hosting support on IIS in addition to out-of-process hosting model that was before. It seems it is just an optimization that allows to avoid the additional cost of reverse-proxying requests over to a separate dotnet process. IIS will recycle application pool with Asp.net Core application
I have do a experiment
use ' IApplicationLifetime applicationLifetime ' like aspnet Golbal.aspx
When the iis application recycle , the registerd 'ApplicationStopping'
be triggered.
SO i will belive the https://github.com/aspnet/KestrelHttpServer/issues/1040#issuecomment-267506588
Nope, It would not. IIS application pool only takes care of w3wp.exe process.
ASP.NET Core is hosted by Kestrel process, and IIS is just a reverse proxy in front of it.

Application Pool

I have some doubts about Application pool
Multiple application in One Application pool running under the only worker process by default
Multiple application in One Application pool We can assign different worker processes for different applications.
Above is my Understanding about Application pool and worker process
I want to clarity in these concepts, If anybody have please explain me.
Thanks,
Dnyaneshwar
I think your understanding is almost correct.
When you create a new web site in IIS it creates an application pool
for you with the same name as the web site, so in fact the default is
every web app gets its own application pool.
You can set single application pool to host multiple IIS web sites. The
effect is that all the sites sharing the app pool are hosted in the
same exe. If you restart/recycle this app pool, it will restart all the web
sites it is being used in.
You can isolate different web sites by assigning different
application pools to each web app (as mentioned IIS does this by default)
One application pool has a single worker process (w3wp.exe) by
default but but you can increase this.

What is the difference between DefaultAppPool and Classic .NET AppPool in IIS7?

I have a problem with timeouts in IIS. In the web.config the session timeout was set to 60 minutes but after 20 minutes the session ends.
This problem only occurs in IIS7 and not in IIS5.
After some investigation, I discovered it was due to the application pool's timeout. If the App Pool is left 20 minutes without doing anything, IIS ends the session.
If the application is using the defaultAppPool this always happens but if I change the App Pool to the classic .NET App Pool, the timeout does not occur.
Both modes have idle timeout but only in the DefaultAppPool this occurs.
Why is this?
What is the difference between be a Classic .NET AppPool and DefaultAppPool?
What is the difference in the pipeline, between Classic and Integrated?
IIS7 has some major changes to better support WCF and one of the key pieces is the new integrated application pool. This session from PDC talks about some of these challenges from the perspective of making WCF services perform better: http://channel9.msdn.com/pdc2008/TL38/
This page has a good overview of IIS7 architecture: http://learn.iis.net/page.aspx/101/introduction-to-iis7-architecture/.
I've included some of the key information from this article on the purpose of the two different kinds of app pools below:
Integrated application pool mode
When an application pool is in
Integrated mode, you can take
advantage of the integrated
request-processing architecture of IIS
and ASP.NET. When a worker process in
an application pool receives a
request, the request passes through an
ordered list of events. Each event
calls the necessary native and managed
modules to process portions of the
request and to generate the response.
There are several benefits to running
application pools in Integrated mode.
First the request-processing models of
IIS and ASP.NET are integrated into a
unified process model. This model
eliminates steps that were previously
duplicated in IIS and ASP.NET, such as
authentication. Additionally,
Integrated mode enables the
availability of managed features to
all content types.
Classic application pool mode
When an application pool is in Classic
mode, IIS 7.0 handles requests as in
IIS 6.0 worker process isolation mode.
ASP.NET requests first go through
native processing steps in IIS and are
then routed to Aspnet_isapi.dll for
processing of managed code in the
managed runtime. Finally, the request
is routed back through IIS to send the
response. This separation of the IIS
and ASP.NET request-processing models
results in duplication of some
processing steps, such as
authentication and authorization.
Additionally, managed code features,
such as forms authentication, are only
available to ASP.NET applications or
applications for which you have script
mapped all requests to be handled by
aspnet_isapi.dll. Be sure to test your
existing applications for
compatibility in Integrated mode
before upgrading a production
environment to IIS 7.0 and assigning
applications to application pools in
Integrated mode. You should only add
an application to an application pool
in Classic mode if the application
fails to work in Integrated mode. For
example, your application might rely
on an authentication token passed from
IIS to the managed runtime, and, due
to the new architecture in IIS 7.0,
the process breaks your application.
The classic pool processes the requests in the app pool by using seperate processing pipelinesfor IIS and ISAPI. integrated uses an integrated pipeline, IIS and ASP.NET a(better performance) takes advantage of the improved features of IIS 7.0 using only the one process.
Good practise is to create a new application pool for each application, then configure sepeerately according to application requirements.
Classic mode follows the steps below :
1.The incoming HTTP request is received through the IIS core.
2.The request is processed through ISAPI.
3.The request is processed through ASP.NET.
4.The request passes back through ISAPI.
5.The request passes back through the IIS core where the HTTP response finally is delivered
Integrated mode uses:
1.The incoming HTTP request is received through the IIS core and ASP.NET.
2.The appropriate handler executes the request and delivers the HTTP response
Increase the session timeout in web.config as per
remember increasing this causes the application to consume more resource, eg memory
I think your question has the answer in it. IIS 6 and 7 have a concept of Application Pool timeout, this is different from session timeout.
What is the difference between modes ... already addressed. I'm uncertain about how your questions regarding pipelines and differences in modes relate to your problem - the timeouts.
Some perspective: Idle timeout won't occur on a web site with any traffic. You've probably got a problem that only occurs in a QA site or your dev box. The idle timeout setting exists to save resources on your dev box and $5/month hosting companies with lots of underused web sites (e.g. my blog). You probably do not want idle timeout on a public site.
Session timeout - set in web config, if a user doesn't hit the server, their session times out.
Idle timeout Noone touches the web server at all for 20 minutes, so shut down to save resources. In IIS 6, this is on the performance tab of the app pool - and is easy to disable. In IIS 7, you can set in in application pool advanced settings or in the processModel element. I don't run as much IIS 7 as IIS 6, but it looks like removing the element from web.config, or setting to 0, gets infinite idle timeout.
The DefaultAppPool ignores settings for session timeout in web.config, but ASPNet App Pool will use the settings in web.config.

Resources