Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

web app slow performance when leave idle for some time

We have a web application deployed on IIS 7.5 target framework 4.0 the application perform slow when leave idle for few minutes for first time and then perform as expected this happened each time application is idle. With the help of fiddler I found its TCP/IP connection which is taking time about 21 secs whilein subsequent calls this time is 0. The Idle time out is also set high and connection time out is also high in the IIS settings. server is - Windows 2008 R2. there is nothing in the event viewer related to the website. we used form authentication but the time out for that is also set about 10 hours in the config file.

Can anybody point me to the setting with is affecting the response time after the app is idle for some time. Note - this was working proper when deployed withing the LAN but this problem starts when deployed out of the LAN or in separate domain.

like image 667
user2803805 Avatar asked Sep 22 '13 08:09

user2803805


2 Answers

  1. Problem

here is the problem in IIS app pool idle time out, its by default set to 20 minutes, after 20 minutes app pool shutdown if no request within 20 minutes, when any request comes after 20 minute its again start, The problem is that the first visit to an app pool needs to create a new w3wp.exe worker process which is slow because the app pool needs to be created, ASP.NET or another framework needs to be loaded, and then your application needs to be loaded. so it may take time 20-30 seconds or depends on the application content size.

  1. Solution

so to avoid this type of delay we need to set the idle time out to 0. now it will always load fast.

  1. app pool setting

enter image description here

like image 128
adnan Avatar answered Oct 21 '22 03:10

adnan


The IIS application pool is shut down after 30 minutes of inactivity. After that, when you make a request IIS basically has to start the website up again, which leads to the behavior you are describing. You can change the idle time of your website in IIS though to avoid it.

You could also look into the Auto-Start feature of the 4.0 framework.

like image 25
shamp00 Avatar answered Oct 21 '22 03:10

shamp00