windows azure website load time
Asked Answered
U

5

24

Sometimes when I access my windows azure website, the initial response time is very slow. After the first page load the website is fast. Some background: The website is not that often visited at the moment. Further, I am using a keepalivecontroller to keep the website running and the website is running in shared mode. I am wondering: are websites that are not that active removed from memory in windows azure? Or is it just that background tasks on the operational level of windows azure are interfering sometimes? It is not transparent for me what is happening, so is there some sla of something for windows azure websites?

Uranology answered 31/3, 2013 at 14:41 Comment(0)
R
17

There is now a new feature available for Windows Azure Websites in 'Reserved' mode that will keep your website warm. You can now turn on "Always-on" under the "Configuration"-tab on your Azure Website. As explained in this blog post:

When the new “Always On” feature is is enabled on a site, “Windows Azure will automatically ping your website regularly to ensure that the website is always active and in a warm/running state,” Guthrie writes. “This is useful to ensure that a site is always responsive (and that the app domain or worker process has not paged out due to lack of external HTTP requests).”

Rommel answered 25/1, 2014 at 13:1 Comment(4)
Why would this ever be off?Susansusana
It looks like it works only in Basic or Standard mode, not Shared mode (the OP runs its website in Shared mode) (azure.microsoft.com/en-us/documentation/articles/…)Schramke
It doesn't work very well anyways. I always have this enabled on azure websites and it still will usually take 30 seconds or so to start an app if nobody has accessed it recentlyRubiaceous
I agree with EOLeary, as of today. The Always On doesn't seem to do much after deployment.Ambience
F
13

Easiest way to keep a website warm is to call it regularly using the Scheduler feature in Windows Azure Mobile Services.

You simply write a script in the Scheduler that pings your website every x minutes.

Here's a post covering how to do that: http://fabriccontroller.net/blog/posts/job-scheduling-in-windows-azure/

Filariasis answered 1/4, 2013 at 14:11 Comment(0)
S
2

The Windows Azure Web Sites are still in preview, so there is currently no SLA with that service.

The Web Sites do idle out when in free or in Shared mode, which is likely what you are seeing. When the site idles out it actually is removed from memory, and indeed the IIS process host running the site is shut down. This is how they can get the density of hosting 100 sites on the same VM.

You can find a lot of info on the Channel9 site about why this is the case, or, as a shameless plug, here is an article that talks about how the process is handled.

Now, you mentioned that you were using a keepalivecontroller, but what exactly do you mean by that? I use pingdom.com to contantly request data for one of my websites, and that seems to do pretty well. It is still possible that a request doesn't come in and the idle time is met which then cycles the site. It is also possible that even if you always have the site running that the VM the site sites on needs to have the underlying OS updated, in which case Azure would then move the site process to another VM, which could also cause the slow start up on the next request.

I'd start logging your application start ups and then look through your logs to see how often that is happening.

Stimulus answered 31/3, 2013 at 15:56 Comment(2)
I have a task that is running on a separate thread and that just requests the homepage with the help of the WebClient class. Often, it seems to work fine indeed, so I also think that maybe it's an OS maintenance thing. I find it just kind of disturbing that it is not transparent what is happening on the machine the website is running. But I suppose you always have that with a shared machine. I'll check the logs indeed. Great article, by the way!Uranology
I do not believe that the CPU work of a site is considered to keep the site going, but more around requests for that site, which is why something like pingdom.com works since it causes a site to be requested from outside the site itself. Others have done things with Windows Azure Mobile Services Scheduler as well.Stimulus
H
1

If you only need to warm it up once (vs keeping it warm) and are mostly trying to prevent your customers experience page cold starts, I believe the correct tool is IIS Application Initialization. You can configure it with a list of urls to hit before it deems the app ready for action.

My site is suffering from page cold starts and that is severely magnified in Azure Websites (even on an S3), but it is absolutely speedy after its served that first time thanks to several layers of caching (our inefficient use of Umbraco's dynamic nodes query language creates a lot of database churn--which we're cleaning up opportunistically).

From what I've read and my own web.config attempts this is still not available in Azure Websites. I've asked Microsoft for it here: MS IDEA: Application Initialization to warm up specific pages when app pool starts. Please consider voting for it.

Heinz answered 16/1, 2015 at 16:47 Comment(0)
D
1

For each service/site you need to go to "Configure", then switch "Always On" to ON. Also make sure you click Save; it took my website about 2 minutes before noticing the change.

Why this is not the default is kind of mind boggling, because my setup on HostGator was running much faster than Azure. I guess Microsoft is figuring if nobody is accessing your site, it's okay if it has a long load time.

Doddering answered 2/1, 2016 at 18:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.