October 16, 2013, 8:00 AM — Anyone who has hosted websites on a Windows Server using IIS knows how painfully slow the response time is on the first request to a site. With the latest version of the .NET Framework 4.5.1, a new feature called App Suspend aims to correct that issue and boost hosting density at the same time.
One way IIS conserves resources in web hosting scenarios is by placing idle timeouts on worker processes which haven’t seen any activity in a period of time. This frees up CPU and RAM for sites which are receiving traffic and allows for a single server to host many sites simultaneously. A downside of this approach is that once a worker process times out, it takes a significant amount of time to spin back up and load into memory when a request does come in for a site on that app pool.
Starting in Windows Server 2012 R2 and .NET 4.5.1 (I know, not exactly backward compatible), a new “Suspended” worker process state has been added. While all sites still start out as inactive, after they are activated and the inactivity timeout threshold is crossed, the site is transitioned into a suspended state rather than becoming terminated. In this suspended state, the CPU and most RAM resources are released, but the app is kept at the ready which allows it to be resumed very quickly.
The best way to think of this feature is to imagine the functionality on your mobile phone or in Windows 8 apps. Once you open an app and it’s loaded, you can go back to the home screen and the app state is preserved. You can then reopen the app much more quickly since it’s been waiting for you in the background (unless you force close it from the multitask screen). This is essentially the same thing.
Microsoft is claiming some impressive speed boosts using this method, especially when loading resource intensive applications such as DotNetNuke. Their in-depth article shows a 90% reduction in start up time vs. a cold start of an application. If that wasn’t enough, they have also seen a 7x improvement in hosting density using the new suspended state. That means that you can host 7 times as many sites on the same server hardware using App Suspended. If those claims are true, and you’re a hosting provider, that might just pay for the upgrade to Windows Server 2012 R2 right there.