ASP .NET Website; first load of every page is very slow - asp.net

I'm facing with the following situation:
On an ASP .NET website(this is maybe important, it is not a web app. project, it is a website project in VS) the aspx pages load very slow for the first time; and the key is, that EVERY page is loading very slowly for the first time, not only the very first page after an app pool restart;
Of course I know that the app. pool is stopped after a certain amount of idle time, and after restarting the very first page load can be slow; but I think this is not the case in this site, since every page's first load is slow after deploying the website to IIS.
It seems that every page is compiled at the time when it is first loaded, don't know, if it's possible at all.
Any ideas, what can cause this, and how to avoid?

Related

Slow ASP.NET site when not providing a page name

On my ASP.NET Site (.Net Framework 4.5) if a user provides a pagename such as http://staging.site.com/index.aspx the site loads as expected and the user can navigate around the entire site without issue.
If the user loads the site and than changes/visits a URL that redirects to the root http://staging.site.com/ with no page name, the first load hangs up for over a minute and than all requests thereafter are also slow.
The issue is only isolated to the users session. It does not affect other users.
Turns out we had enabled session variables to be used in our webapi classes. And the overhead of doing this was causing the server performance to decline significantly

ASP.NET website performance

Does any one know if number of ascx files in an ASP.NET website (not application) has anything to do with warm up performance?
Let's say that all website pages are included into ascx files and are loaded into one page and let's say that there are more than 200 ascx files in the project.
I noticed that when the IIS restarts and the website wants to warm up, there is a good 30 seconds delay, I want to find out what are reasons for this delay.
I have checked the database calls (they are no more than 7 seconds in total).
I need to add that once the first page is loaded, reloading the same page has no delay (instantly loads).

ASP.NET keep alive page using aspx vs. html

I have having trouble with my hosted site taking a long time to render the first page when it has not been accessed for a while. I wanted to create a keep alive page that I would call every 15 minutes to make sure the site stays up and running. Can I create an html page or must I create an aspx page for this to work? Will the thread pool recognize the html page that is not part of my ASP.NET project and make sure the site is not shut down?
You're going to have to create a page which hit's the .net process. You can do an html page, but you're going to have to have something on that page that hit's the asp.net process.

Weird webpage loading behaviour

I have a website that I'm hosting on a public IP using IIS 7.0. (using c# asp.net 3.5)
I find that if I navigate to the webpage for the first time in a day. It loads endlessly and nothing shows up. Then when I re-press enter in the address bar, it loads right away and everything works fine.
From then on, when I got to the address again it loads quickly.
I don't think this is a compilation issue as all my code is pre-compiled.
Any ideas what might be causing this behavior?
Thanks!
Andrew
I had a similar problem which turned out to be caused by the IIS app pool recycling.
In my case, the website had outgrown its hosting package and as soon as it hit the arbitrary memory limit, the app pool was recycled and the application restarted, recompiling on the first page view.
You can check for this by adding a Global.asax and handling the Application_Start event. You could write logs to a database or send an email notification with whatever debug details you want.
I also handle Application_Error which offered up some useful info.
If you notice Application_Start happening several times a day, you may have a memory leak or similar issue.

ASP.Net / Umbraco Website has (initially) very high server response time

I've got this problem.
I launched an ASP.NET website with the Umbraco CMS on an ISP.
(Its just a very basic informative site. nothing special.)
When I go want to visit the website however, the first pageload takes a lot of time, sometimes even up to 20 seconds. Of course this is ridiculous.
Afterwards, I am able to navigate the site relatively quick..
So every first pageload is slow, then everything is OK, more or less.
Does anybody have any idea what the problem could be? Would it be IIS? ASP.NET?
IIS is probably configured to shutdown the application pool after N minutes of inactivity.
AFAIK, this is the default behaviour on IIS.
If it is the first request to be served, IIS at least starts the APP Pool. This might take a bit of a time. Maybe Umbraco loads initially some data, but I did not have any experience with Umbraco, so that's beyond my knowledge.
-sa
What do you meen by first page load?
Have you just done a build? If this is a website then .Net will compile and load the dll. Then IIS will cache page outputs.
Do you have any large images on the page?
Essentially there are an infinate number of reasons. Have you used firebug? Determine where the loadtime is?
Do you have a link?
You may want to look into a keep alive service. There are many available that regularly poll you site to keep the application pool running and prevent the startup delay you are seeing. More information here and here.

Resources