skip to Main Content

When i use developer tools to analyze the network load times I see that my time to first byte is sometime 8 seconds long when loading the Index.aspx document.

My pages are optimized and are never greater than 1.4 megabytes in size.
I optimized my images to be below 100 kilobytes.
I precompile my website on publish.
I set debug=”false” in the web.config file.

After the website has taken a long time to compile everything loads very fast.
I am using GoDaddy’s shared Plesk hosting.

2

Answers


  1. Chosen as BEST ANSWER

    Found the problem. GoDaddy's shared Plesk hosting has a fixed 5 minutes until the idle worker process shuts down. When the worker process shuts down, your website essentially goes to "sleep" and takes a long time to "wake-up" when a new visitor hits the site.

    The solution is to get more traffic or to ping the website every 5 minutes to keep it running.


  2. Ok I think I see what the problem is. ASP.NET pages need to be JIT compiled before they can render. So the first time you make a request to the server, the entire site is compiled from a CIL .NEt binary to native machine code. Once compiled that native code is cached on the server in the running app pool. If the server has no traffic for a while (generally the default is 20 minutes) then the cached native code is cleared out so the next time you hit a page, it takes a while to compile the code. This is a common issue with ASP.NET WebSites and WebForms applications. There are a few ways that you can deal with this.

    1) The manual method (not ideal) – If the site only needs to be accessible during business hours you could hit the site first thing in the morning, and every request after will be quick
    2) Lengthen the cache duration, but since this is hosted on GoDaddy/Plex I don’t know how much control you will have over the AppPool
    3) Create a light weight windows service whose sole purpose is to ping the website every 10 – 15 minutes to keep the cache alive and keep the site responsive

    Option 3 feels like a little bit of a hack, but I have used that approach on many projects where the site is not constantly being hit by users throughout the day, but I wanted to make sure that no one user had a bad initial page load experience.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search