Search code examples
sessioniisiis-7application-pool

Will recycling an IIS application pool cause problems for in-progress sessions?


I am using IIS 7.5 on Windows 2008 x64 server, ASP.NET MVC, and .NET framework 4.

If I recycle the application pool while my web application is running and users are logged in, will 1) users' sessions and associated data be destroyed, and will they have to log in again? And, will requests in progress at the moment I recycle fail, or will IIS finish those before performing a recycle?

What are the negatives to recycling my web application's application pool while the application is in use?


Solution

  • If you are doing session management in memory then you could have some issues. If you are doing proper session management (for example, in a database) then the users should be fine. You will encounter a slowdown as the new app comes up and begins loading things into memory to serve requests though.

    Requests in progress are given a chance to finish, but only a limited chance (by default they have 90 seconds).

    The downsides to a recycle are basically in two categories:

    1. You have to reload everything into memory (this takes time, during which users are waiting).

    2. Long running requests will be killed (by default an application pool has 90 seconds to complete its business, something like a long file upload/download might have to be restarted because it overlapped a recycle).