Skip to content
Windows Hosting

How to Configure an IIS Application Pool for ASP.NET Core

In this article9 sections

Every ASP.NET Core site on IIS runs inside an application pool, which is the process boundary that keeps one site from affecting another. The pool decides how the app starts, how long it stays idle, when it recycles and which account it runs as. A wrong setting shows up as slow first requests, a site that goes down at a fixed time, or a 503 error when the pool stops. This guide explains the settings that matter for ASP.NET Core, how to set them in Plesk on Windows hosting, and how to check that the pool is healthy.

Siteharbour’s Windows hosting plans run IIS 10 under Plesk, and each website gets its own application pool. The settings below are the ones you can change in Plesk and in IIS, and the same values apply on any Windows server.

Know the settings that matter

  • .NET CLR version. For ASP.NET Core, set this to No Managed Code. The ASP.NET Core Module hosts the app itself, so IIS does not load the older .NET runtime into the pool.
  • Pipeline mode. Integrated is the default and is correct for ASP.NET Core.
  • Identity. Use the default ApplicationPoolIdentity. It gives the pool the rights it needs and no more.
  • Idle timeout. The time before an idle pool shuts down. A short timeout saves memory but makes the first request after a quiet period slow.
  • Recycling. The scheduled restart of the pool. It clears memory and can run at a quiet hour.

Step 1: Set the .NET CLR version to No Managed Code

In Plesk, open the website and find the hosting or application pool settings for it. In IIS Manager, which the host may let you use, open Application Pools, select the pool for the site, and choose Basic Settings. Set .NET CLR version to No Managed Code, and keep the pipeline mode at Integrated.

Expected: the pool shows No Managed Code. If the pool is set to an older CLR version, the ASP.NET Core app can fail with an error about the runtime, which is the same family of problem as the one in how to fix ASP.NET Core 502.5 process failure on Windows hosting.

Step 2: Set the idle timeout and the start mode

Under Advanced Settings, check the Start Mode. Set it to AlwaysRunning for a site that needs a fast first response, such as a shop or a booking page. The pool then starts with the server, and the first visitor does not wait for the app to load. For a small site with little traffic, the default OnDemand is fine and uses less memory.

The Idle Time-out setting closes the pool after a quiet period. For a site that sees steady traffic, set it to 0, which disables the timeout. For a site that is quiet most of the day, a value of 20 minutes is a reasonable compromise.

Step 3: Set the recycling schedule

Recycling restarts the pool, which clears memory that the app may hold. Under Recycling, set a fixed time when traffic is lowest, such as 3 AM in the server’s time zone. Avoid recycling at a busy hour, because each restart makes the first requests after it slow.

Expected: the recycle time appears in the pool’s settings. Do not set a recycle at a fixed interval, such as every 30 minutes, unless you have a reason. Frequent restarts hide a memory leak rather than fix it, and the leak should be found in the app.

Step 4: Check the identity

Under Identity, confirm the pool runs as ApplicationPoolIdentity. A pool that runs as an administrator account gives the app more rights than it needs, so an attacker who finds a flaw in the app gets those rights too. Give the app access only to the folders it writes to, such as its logs and its uploads.

Step 5: Check the pool is running

After any change, check that the pool is started. A stopped pool returns 503 Service Unavailable on every request. Start it from IIS Manager, or from Plesk’s website settings, and load the site. Expected: the home page loads, with a 200 status. Check the Windows event log for pool errors, as described in the 502.5 guide.

Step 6: Watch memory and restarts

Look at the pool’s memory use in Task Manager on the server, or through the performance counters your host provides. A pool that grows steadily all day has a leak, and a recycle will only hide it for a few hours. Find the cause in the app: a cache with no limit, a list that is never cleared, or a connection that is never closed. The same connection problem appears in how to fix MySQL too many connections on cPanel, and the fix is the same idea in the app.

Common mistakes

  • Leaving the CLR version on an old setting. ASP.NET Core needs No Managed Code.
  • Recycling at a busy hour. Every visitor during that restart waits.
  • Running the pool as an administrator. It gives the app more rights than it needs.
  • Using frequent recycling to hide a leak. Find the leak in the app.
  • Stopping the pool to make a change and forgetting to start it. The site returns 503 until you do.

Frequently asked questions

Why is the first request after a quiet period slow?

The pool shut down on its idle timeout, and the app has to start again. Set the start mode to AlwaysRunning, or turn off the idle timeout, for a site that needs fast responses.

What is the difference between a stopped pool and a recycle?

A recycle restarts the pool and it starts again at once. A stopped pool stays down until you start it, and every request returns 503.

Can one pool run several sites?

It is possible, but each site then shares memory and restarts with the others. Give each site its own pool.

Does the pool setting change the app’s speed?

Not directly. It changes when the app runs and how often it starts, which affects the first response and memory use.

An application pool is the boundary that keeps an ASP.NET Core site running. Set the CLR version to No Managed Code, choose the start mode that fits the traffic, put recycling at a quiet hour, and run the pool as its own identity. Check the pool is started after every change, and look for a memory leak rather than hiding it with frequent restarts. For the deployment that puts the app in place, read how to deploy ASP.NET Core on Plesk Windows hosting.

Share this guide