Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

First request is very slow after website sits idle with ASP.NET MVC 3 (IIS7)

I developed a project in ASP.Net MVC 3, my hosting is using iis7 (Win Web Serv 2008 R2), and the first request after the website sit's idle (during about 1-2 hours) is very slow.

I use VPS with 512Mb RAM. Can this be related with a too little RAM?

Can anyone help me with possible causes of such behaviour?

like image 925
Don Tomato Avatar asked Dec 21 '22 21:12

Don Tomato


1 Answers

After a certain amount of inactivity IIS unloads the AppDomain. And then the first request loads the application once again which is slower. You could try to configure this period in the properties of IIS but there might also be other causes that an application unloads such as for example a certain threshold of CPU or memory usage is reached. Those thresholds are also configurable in IIS.

That's not something specific for ASP.NET MVC. It's true for all ASP.NET applications in general.

like image 186
Darin Dimitrov Avatar answered Apr 18 '23 13:04

Darin Dimitrov