Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Services extremely slow when deployed on Azure

I have a rather strange scenario. We have a range of WEBAPIs hosted on the cloud. We consume those services in our Windows 8 application. The problem is when the services are running locally it takes less than 400ms but when hosted on Windows azure it takes upto 20 seconds for some requests. I have checked the indexes of our database tables and its fine. I have no clue so as to what to profile and how to improve the performance. Thanks!

like image 462
Kaarthik Avatar asked Aug 06 '13 04:08

Kaarthik


People also ask

Why is Azure so slow?

If you are using shared storage services such as Azure Files it also means that you need to understand the performance is linked to the size of the share. So, if you have applications or other services that are dependent on a shared folder, and you haven't properly sized the share you will get crappy performance.

How can I improve my Azure performance?

Scale your cache to a different size or SKU to improve cache and application performance. Cache instances perform best when they're not running under high memory pressure, high server load, or high network bandwidth.

When should you scale out your deployment in Azure?

Scaling out will take your application and clone it as many times as necessary, all while adding a load balancer to make sure traffic is spread out evenly. Scaling up is the best approach if you have low traffic activity but are still seeing resources peak to 100%.


1 Answers

Everyone Thanks a lot! But I found a way to use dottrace(Excellent profiling tool) on the azure deployment. Here is the link

http://blog.maartenballiauw.be/post/2013/03/13/Remote-profiling-Windows-Azure-Cloud-Services-with-dotTrace.aspx

You can also use windows azure diagnostics and stopwatch class to log all times to the wad tables. Also found out that the first request to the azure service is always slow in another thread. Have just copied it here below

Serkan, you would need to first make sure in your post, weather you have published a Cloud Service or a Website to Windows Azure. Based on Cloud Service (A Web Role) or a WebSite the answer to your question will be different. As you want to learn more I would explain what goes on behind.

As you suggested that your first connection is slow, I can see that happen with Windows Azure Websites. Windows Azure Websites are running in shared pool of resources and uses the concept of hot (active) and cold (inactive) sites in which if a websites has no active connection for x amount of time, the site goes into cold state means the host IIS process exits. When a new connection is made to that websites it takes a few seconds to get the site ready and working. Depend on how your first page code is, the time to load the site for the first time varies. Similar discussion is logged: Very slow opening MySQL connection using MySQL Connector for .net

With Windows Azure Cloud Service the overall application model is different. Your webrole has its own IIS server which is fully dedicated to your application and above Website limitation does not occur however there could be other reasons which could have slower page load. If you are using WebRole, then what you could do is run a page load profiler first and RD to your Azure Instance to collect the page load data to see what else you could do to boost the performance.

like image 76
Kaarthik Avatar answered Oct 03 '22 21:10

Kaarthik