Single application pool vs multiple application pool [ASP.NET Core]

There are often debates on whether to deploy ASP.NET applications in a single application pool, or assign a application pool for each application. In case of ASP.NET MVC with .NET Framework, the cons involved in the latter are:

  1. Each application pool has it's own memory pool, hence memory will deplete quickly, especially if you are hosting quite a number of applications in your server.
  2. It would difficult for you to perform updates on just a single application, especially if it requires you to turn off the application pool.
#2 can be solved quite easily with the use of load balancer, since you could divert traffic to other server while you perform maintenance on the current server. However, there is no easy solution to #1 but to increase the memory of your server.

Initially, I thought the same would apply to ASP.NET Core applications. However, we need to remember that IIS is just a reverse proxy in ASP.NET Core application, at least if you choose the out-of-process hosting model. Even if we deploy all our ASP.NET applications into a single application pool, we would not be able to save much memory, since each application will be running on the Kestrel server (dotnet.exe) and IIS would just consume a negligible amount of memory as a proxy.

Hence, it would not make much sense to try to cramp everything into a single application pool, especially when .NET Core 2.2 (and above) offers in-process hosting model, which would make your application faster due to the reduction of overhead. You can easily find the benefits of in-process hosting compared to out-of-process.

Comments

Popular posts from this blog

ASP.NET Core service locator pattern

Caching and generic query using NHibernate [.NET Core]

Ways to perform eager loading via NHibernate