Azure server response time for web applications

I have a basic (Small) tier of Azure Web App hosted in Western Europe with an SQL database in the same region. Always On is on. Please note that the target audience for my site is in Europe.

Please note that the website is based on CodeIgniter and runs on php 5.6 .

The page loads very slowly, although everything is fast in the local environment. After running PageSpeed ​​Insights on my site, I get the following rating:

Reduce server response time In our test, your server responded in 1.7 seconds. There are many factors that can slow down server response time. Check out our guidelines to find out how you can track and measure where your server spends more time.

When you check a site with developer tools get a similar picture: enter image description here

As you can see, the initial answer is really bad. What could be the problem?

UPDATE / SOLUTION

Accepting the recommendations of Gary Liu - MSFT from the comments, namely: the inclusion of pconnect in database.php , the page load time decreased to 0.23 seconds, that is, an improvement of ~ 8x .

+1
source share
2 answers

In the CI environment, if you are using a prod application, we can set pconnect to true in config/database.php to use a persistent database connection. Which can reduce the delay on the initial connection.

By the way, if you are using a test or dev application, we need to carefully examine this parameter, because this can cause several unexpected problems. You can refer to the answer Advantages / Disadvantages of the pconnect option in CodeIgniter for more information.

0
source

I found that the Entity Framework is responsible for the long initial (cold start) responses. Disabling IIS from the timeout did not help, I think there should be some kind of EF pool \ memory timeout that is not advertised.

You can disable some EF checks for version control of DBs and try using a precompiled view that helps a bit. I am still very dissatisfied with the EF startup time when working on Azure connecting to the preliminary DB. The start-up time in the preliminary phase is about 1 second, but none of what I did can get my cloud during the start-up time up to 10-12 seconds. I came to the conclusion that there is a lot of network overhead for pre-selling, and I suspect that using Azure SQL also creates a lot of network overhead, as it is open to the public.

+2
source

All Articles