Services are extremely slow when deployed to Azure

I have a rather strange scenario. We have a number of WEBAPI hosted in the cloud. We use these services in our Windows 8 application. The problem is that the services are performed locally, it takes less than 400 ms, but when placing azure on Windows, it takes up to 20 seconds for some requests. I checked the indexes of our database tables and their fine. I have no idea what to do and how to improve performance. Thanks!

+6
source share
2 answers

Thanks everyone! But I found a way to use dottrace (a great profiling tool) on azure deployment. Here's a link

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

You can also use azure diagnostics for Windows and a stopwatch class to write all times to wad tables. It also turned out that the first request to the azure service is always slow in another thread. Copied it here below

Serkan, you first need to make sure that you have published a cloud service or website for Windows Azure. Based on a cloud service (web role) or website, the answer to your question will be different. Since you want to know more, I will explain what happens next.

As you suggested that your first connection is slow, I can see it happening with Windows Azure websites. Windows Azure websites operate in a common resource pool and use the concept of hot (active) and cold (inactive) sites, in which if the sites do not have an active connection for x time, the site goes cold, which means that the IIS host exits process. When a new connection is made on these websites, it takes a few seconds for the site to be ready and working. Depending on how your code is on the first page, the site’s loading time for the first time changes. A similar discussion is being recorded: very slow opening of a MySQL connection using the MySQL Connector for .net

On Windows Azure Cloud Service, the overall application model is different. Your webrole has its own IIS server, which is completely dedicated to your application, and the website restriction does not occur above, however there may be other reasons that may slow down the page loading. If you are using WebRole, what you could do is first run the page load profiler and RD in your Azure Instance to collect page load data to find out what else you could do to improve performance.

+4
source

You will obviously need to profile the application to find the real reason. Check out these two articles to get you started:

0
source

Source: https://habr.com/ru/post/951086/


All Articles