Take the 2-minute tour ×

I have uploaded my ASP.NET MVC(3) site to my host but it site is alot slower in first time load of all pages(even with no data fetch)?

First time I visiting startpage It takes 7.30 s, if I hit reaload after 1 min it will take 1.05 s, if I hit reaload repetly it will give me between 500 ms and 800 ms.

If I return after around 5 min and hit reaload I will get a 7 s load again?

If I run the same websight from my localhost(IIS7) I will get 1 s first time and then 650 ms for rapid reload.

The webpage is using database but its the same database in both cases (that is placed at my host).

The webpage is www.biss.se

Where should I begin to look?


This is my Application_Start()

protected void Application_Start()
    AccountModel accountModel = new AccountModel();


    #region Register Extra DataNotations for Display Attribute
    ModelMetadataProviders.Current = new DisplayMetaDataProvider();

    if (!accountModel.CheckIfAdminAccountExists("adminAccount"))
                                    postCode: "",
                                    locationId: "",
                                    inactive: false,
                                    siteRole: Controllers.SiteRoles.Admin,
                                    activatedByUser: true);

share|improve this question
Are you using shared web site hosting, running your own server, or using a VPS? (I assume you're using a web site host?) –  mawburn Jul 8 '12 at 19:32
If you're using a shared hosting, this is expected. Hosters like Winhost, typically only give your MVC3 app 100MB of memory, and once that threshold is reached, or a certain period of inactivity is reached, the entire application pool is recycled. The lag you feel after browsing for a bit could be your memory reaching it's peak. –  Only Bolivian Here Jul 8 '12 at 20:19
@MadBurn : Yes this is a shared host but my friends www.bradspel.net is running fast at the same host(same server) and that is a ASP.NET Webform 3.5 site (none MVC). –  Ivy Jul 8 '12 at 20:46
@Sergio Tapia : Thanks, I will contact my host and see if there is somthing thay could help me with but I would like to make sure that Im not doing anything wrong with ASP.NET MVC that would result in this slow performance. –  Ivy Jul 8 '12 at 20:47
Note that this is for every pageView the first time so its not only the first page visited. Pleas try. –  Ivy Jul 8 '12 at 21:11
show 1 more comment

3 Answers

up vote 6 down vote accepted

When the first request hits an ASP.NET application, this application is loaded in memory by the web server by creating an AppDomain and the code inside Application_Start is executed. This process could take more or less time depending on the actions you are performing inside this event and the number of assemblies to be loaded. After a period of inactivity or if certain memory/CPU thresholds are reached IIS could recycle the application and unload it from memory. On the next request the same process repeats.

So basically what you should be looking for is the tasks you are performing inside your Application_Start event which is executed upon the first request. If those tasks involve I/O operations such as database access or stuff you could log the time it takes to perform them. This way you will be able to pinpoint the exact procedure of your code that take long time and be able to fix it if it depends on you, or contact your hosting provider if it is a problem on their side.

The MiniProfiler is a great tool for this profiling purpose.

share|improve this answer
Thanks, Interesting! I have updated my post with the Application_Start and we can see that there is vary litle work there. Also, the same problem should exist on localhost but it does not? I will look in to the MiniProfiler. I can also mention that a friend are running bradspel.net on the same host and this is a regular ASP.NET 3.5 website and it is much faster. –  Ivy Jul 8 '12 at 20:45
I also have to add that if you try to visit any of the other pages on this site you will notice the same slow delay the first time so it seemse not to be application_start if its not recycling for every request. –  Ivy Jul 8 '12 at 21:11
It's not necessary that the same problem exists on localhost. On localhost you are probably directly connecting to some local database or something. If you are saying that you are experiencing the same slowness on each request it seems that every database access has problems. I guess you will have to contact the support for your web hosting provider. We cannot help you. The problem doesn't seem to be with your code. Before doing that, use a profiler the measure the time it takes to execute a query and be able to pinpoint the problem. –  Darin Dimitrov Jul 8 '12 at 21:18
add comment

You should look into your IIS settings. IIS shuts down all sites witch was not hit by requests for a certain period of time.

So if there was no requests for a few minutes site ll be unloaded from memory and need

Thats the reason you have defferent behavior on local and remote machine. Some times hosts block this settings for reason to low memory usage of clients on one virtual machine.

I cant recall the setting to be changed. Some one should give more certain answer.

share|improve this answer
add comment

Just had the same behavior with an ASP.MVC3 app running on IIS8 Windows2012 server.

If you are sure of what you are doing you can configure IIS to keep your app pool alive.

The solution can be found here on G+

The most important thing is to configure the idle time-out setting for the application pool.

share|improve this answer
Please, try to read this stackoverflow.com/help/deleted-answers, to get more understanding how to not answer. Namely: "Answers that do not fundamentally answer the question": barely more than a link to an external site. If possible extend your answer with extract of the solution –  Radim Köhler Aug 9 '13 at 14:29
add comment

Your Answer


