Is One Web application effect on other web application? - asp.net

i have to configure one web application in IIS, as i know i have to create one web site for my application and assign one application pool.we can set one application pool with different websites.if one ore more website have an issue and stop working in this case my application can work as it is or it will stop.
please suggest me what i have to do create another application pool for my website or use existing.

Related

How to persist connections during code update in ASP.NET MVC

When one updates an ASP.NET MVC app in IIS the framework keeps the connections open. All responses to the connections are sent once IIS has caught up. Unfortunately this can take some time (eg. 15 seconds). Is there any way to update part of the app without affecting connections to another part.
An example use case: if you have a web chat app and you want to make a minor change to one section of the website, can it be done without 'pausing' the connections to the chat app.
If you can physically separate the code into its own folder, I.E. (c:/inetpub/wwwroot/myapp and then c:/inetpub/wwwroot/myapp/chatapp), you could define "chatapp" as its own application within the IIS website, and then create a new application pool just for that application. I had to do this before because the project I was running needed to have part of the IIS site on a different recycle schedule due to performance issues, also it crashed a lot so it was advantageous for it to have its own process so it didn't take everything else down with it :)

What exactly is the App Pool?

Ok so I understand how app pools work and what they do but I am wondering what exactly the app pool is, I am thinking at the moment that it is just information the metabase or some config file for use with http.sys?
I suppose another questions is, who or what spawns the worker process when a request is made?
thanks
The confused
First you can see the application pool as the program that actually is one with your pages and runs them. So what ever you make programmatically on your pages are done using the application pool.
For example:
user request the page a.aspx
IIS see that is asp.net page and assign it to one app pool
application pool see the a.aspx, check if is complied, and runs it - run your code.
Second you can see the big view, that there are many web sites lives together on one server and application pool is handle one or more web sites together.
Now, a web application can be run on one application pool, or on many application pools at the same time on the same server (this is called web garden). An in each of that you can run many threads.
Now for more details you can read the official microsoft pages.

Run Many ApplicationPools in one WebApplication on IIS 7+

It's possible to run more that one aplication pool in the same WebApplication on IIS 7 or 7.5? I have one web application on asp.net 4.0 that use EF 4.0 and a large set of Entities. Then the First query Its to slow and when the application pool fails, the users need to login again, but the pool was restarted and the first query Its too slow, this cause any can't login for a time (about the time that the old pool is finished and the new pool It's ready).
If I can use multiple applications pools for the same site, on the same port 8080 for example, thats solve my problem. The only way I found was to create a server farm. However, if I understand, each servers would be a virtual or real machine?
You can have multiple applications and associated pools running under one site directory root. In IIS 7 manager, simply right-click on the folder in question and select "Create Application" in the resulting dialog set the new application pool and the physical path. This will mean that you have to segregate your code into separate projects/modules (web applications or web application projects in vs) but they will all share the same site.

Are there any IIS Application-Pool Usage Guidelines?

I've been looking at application pools lately, specifically with ASP.NET applications in mind and I've been struggling to find any best practices for use of application pools.
Of course alot depends of the size and scale of your destined apps in regards to memory limits etc, but I was more specifically thinking along the following lines...
If developing relatively small .net apps which need to be deployed underneath an existing site, should I as a best practice be creating a new virtual directory and application pool for each app?
Or should I just run them underneath the sites already present app pool?
Secondly are there any limits to the amount of app pools you can run (realistically and again assuming small apps with memory limits auto-handled and not defined) on a standard web server?
With resilliance and optimisation in mind my initial thought is to create a new v dir and app pool per app under the parent site - I just wondered if anyone has any thoughts on best practice or links that may assist?
Cheers
For resilience, create a separate application pool for each application. That way if an event occurs in one application that causes the pool to stop, it is only THAT application affected, and not any others on your server.
This also helps in terms of security - the application pool controls the identity of the running application. You should only give just enough permissions for the application to run on the machine. If one application requires access to a specific folder on the server, that doesn't mean you should be giving the same access to all of your applications.

Debugging two web applications in asp.net

I have a solution file containing multiple web applications and components. Mostly these web applications operate independently of one another, but I need to be able to response.redirect from one application to another. This works, and the new page runs, but I can't step into the code in the second web app and debug it.
I have both web applications set to "Always Start When Debugging" = True, with the first web app (the one that's redirecting) set as the startup web application. Does anyone know a trick that will let me step into the code in the second web application?
Open up a second instance of Visual Studio, then Ctrl+Alt+P (menu Tools > Attach to Process) then attach to the appropriate web server process (if you run under IIS this may be w3wp.exe or aspnet_wp IIRC, if you use the built in web server then attach to the process which lists the appropriate port for your project).
Optionally just run the second one and manually go to the first one in your browser by entering the appropriate address and trigger the redirect which you have verified is working.
Are both web applications running in the same process? What version of ASP.Net, IIS, and the .Net framework are you using? Those are my initial questions before I start giving other ideas.

Resources