Our internal site can feel slow on the first visit after a quiet period, then responds normally for the rest of the day. It’s hosted in IIS, and I noticed the app pool has an idle time-out configured.
Could that setting explain the cold first request, or should I be looking at application initialization and app pool recycling instead? I’d prefer not to keep a worker process running forever if there’s a better way to reduce the delay.
What settings have you found make a practical difference for a low-traffic production site?
Yes. If an IIS application pool has been idle longer than its configured limit, IIS can shut down its worker process. The next request has to start that process again, so it may take longer than later requests. This is commonly called a cold start.
The delay depends on what the application does during startup. Loading assemblies, compiling an ASP.NET application, initializing services, and filling caches can all add time. The idle timeout is one possible cause, but a slow first request can also follow an app pool recycle, a deployment, or a server restart.
To check the setting, open the application pool's Advanced Settings in IIS Manager and look at Idle Time-out (minutes). IIS commonly defaults to 20 minutes. If requests arrive infrequently, compare the timing of a slow request with the pool's idle period and check IIS logs or application startup logs.
If the application needs to stay warm, set the pool's Start Mode to AlwaysRunning and, where appropriate, enable site or application preloading with the IIS Application Initialization feature. Setting the idle timeout to zero also prevents idle shutdown, but keeps the worker process resident and may use more server resources. These settings do not prevent every cold start: scheduled recycling and deployments can still restart the application.