IIS 5.0 - Appdomain - asp.net

I am in a bit of confusion here. In IIS 5.0 all the ASP.NET applications run inside the same worker process(aspnet_wp.exe). The various applications are isolated by appdomain. I believe the fundamental functionality of an appdomain is to provide application isolation within a process. Now on to IIS 6.0. I have read about application pools in IIS 6. A lot of sites say that in IIS 5.0 when there is a problem with an application it affects the other applications. But isnt that safeguarded by appdomains? I am being told that application pools in IIS 6.0 prevent that mishaps. I am a bit confused here as to what exactly is advantage that application pools provide over IIS 5.0. I have also been told that in IIS 6 worker process isolation mode, configuring different application pools(and thereby different worker processes) is a perfomant thing to do. But spawning new processes increases the memory utilization and how can it be claimed to be a performant way to do things? Also how does the HTTP.SYS know to route the request to the concerned application poool?

Don't get application pools and AppDomains confused. An AppDomain is a isolation boundary within a process. They are designed to isolate and provide security around managed code that is executing.
Application pools are a feature of IIS that allow a pool to handle requests for multiple sites. They handle this by running multiple AppDomain instances in the worker processes (aspnet_wp.exe, or w3wp.exe). Although technically you can run multiple AppDomain instances per site, generally it is a single AppDomain per IIS Application.
If you have multiple sites in a single application pool (and this sharing the worker processes), if one of those sites starts consuming a lot of resources, this can directly effect the other sites running in the same application pool.
By grouping (and segregating) sites in logical groups (application pools), you can better manage how sites behave.
HTTP.SYS is a kernel mode driver stack that is part of the Windows subsystems. It provides management of the HTTP protocol in kernel mode (versions prior to IIS6 used winsock in user mode). With HTTP.SYS running at the kernel level, should a worker process fail, the request can be queued, and then forwarded to a new worker process which will be spun up.
When you create a site in IIS6, it registers the site with HTTP.SYS which can then route requests coming in to the appropriate worker process.

The Appdomain is about sharing data
http://msdn.microsoft.com/en-us/library/system.appdomain.aspx
and in IIS 6 you can append several applications to an application pool. If you have 2 applications in the same application pool and one of them keeps crashing, it affects the other and IIS will decide to shutdown the whole application pool because of the instability.
Therefore, if you have critical applications, it is recommended to keep them in their own application pool. If you have multiple apps in IIS, you route the requests with the hostheaders (or extra external IIP addresses)
extra resource that recommends an application pool for each production website: http://forums.iis.net/t/1151476.aspx
a nice resource which explains the difference between 5.0 and 6.0 with isolation:
http://www.tech-faq.com/understanding-iis-5-and-iis-6.html

Related

Whether the Default App pool crashes and shut down will affect other App pools running in the same farm / IIS?

We have Windows 2003 Server IIS 6.0 and Windows 2008 Server IIS 7.0
Issue : In IIS 6.0, when Default App pool crashes it shut down other App pools as well.
Whether the Default App pool crashes and shut down will affect other App pools running in the same farm / IIS ?
Other Pools
One pool can affect other in this cases.
Lock some global resource that the rest need to access and all pools gets time outs.
Eat the servers power with bad loops.
Each pool have their space that work aside from the other, so general speaking you need to look for what they have common, like if you use session database and the one locks it for long time, and the other is gets time outs many time together with the first one and fell also on Rapid-fail protection.
Pool it self
The pool is connected with many apps, so when this pool crash, is affect and all apps/web sites that are connected with this.
When this is a problem.
When the pool crash many times and is felt on the "Rapid-Fail Protection" that make the pool to permanently shut down.
When some site is keep the pool inside a loop that eats all resource of it and the power of your server.
here is an example : How do I crash the App Pool?
For the first case you must go to your pool and turn off the "Rapid-Fail Protection". For the second case you need to locate the problem and isolate.
More to read:
Rapid Fail Protection
Configuring Rapid-Fail Protection
IIS app pools, worker processes, app domains

IIS vs ASP.Net Threads

Is there a difference between the threadpool that IIS uses to serve static resources and the threadpool ASP.Net uses?
Is it that IIS needs a thread to service a request, and if that request is for a managed resource (e.g. an ASP.Net request that will run managed code), then that request itself has access to a pool of ASP.Net threads?
How can the two values be configured?
How does the concept of a worker process fit into all of this?
Likewise, how does the concept of an application pool fit into this?

Multiple sites and application pools in IIS for same application load balancing

What is the defacto standard or best practice when it comes to increasing throughput and performance for an ASP.NET web service application?
Would there be any performance increase to method 1 below?
Utilizing the same directory/code, create multiple websites in IIS bound to different VIPs, all running on different application pools. Then use a network load-balancer to balance between the VIPs
Utilizing one website / application pool in IIS bound to one VIP; create additional VM instances and load-balance between the servers
Combination of both method 1, and method 2.

How do I autostart an IIS service on shared hosting (no access to ApplicationHost.config file)?

Is it possible to have an IIS service autostart with no access to the ApplicationHost.config file?
I have shared hosting on GoDaddy, with a few IIS services running. One of these services contains a method that starts a timer and updates some data on my server every 15 minutes. This is necessary for my Windows Phone app to function correctly.
However, GoDaddy seems to restart their servers once or twice every weekday at random times, which stops the service (and the necessary timer) from running until I call the method from a client application. I have to check pretty frequently to see if things are running and then start the service manually.
I'd like the service to start automatically whenever GoDaddy restarts the server, but since it's shared hosting I don't have access to ApplicationHost.config, and there doesn't seem to be an option for it in GoDaddy's IIS settings.
Anyone have any ideas?
Thanks!
IIS will recycle/terminate an idle Web app/w3p.exe every 20 minutes by default, for many good reasons. IIS also have a lot settings to restart Web apps that consume to much resource or generate too many errors. GoDaddy would restart servers regularly to clean up environment, since the servers might host a lot web applications with poor quality.
Basically you can do
You have a 24x7 machine, and you write a program or use cUrl to send
client requests to your Web app every 1, 5, or 10 minutes to wake
up.
If you don't have a 24x7 machine, you may try some function in
Amazon AWS to do wake up/warm up calls. I don't remember the
respective service name in Amazon.
Or you contact Godaddy's technical support about this issue.

Can I set up different worker process for each domain on my website?

I have ASP.NET website on IIS 7 with a lot of domain bindings.
How can I run separate w3wp.exe (worker process) for each domain name?
Is it possible?
One possible way is to create an application pool for each domain. Because each application pool has its own (can be one or more) worker processes, each domain doesn't share worker processes with other domain.

Resources