Webapp first time loads very slowly, like DNS resolution is slow

Nakshatra Nag 1 Reputation point
2022-03-05T06:23:41.797+00:00

1st time you put in my web app URL, loading is slow. But once it loads, it runs fast.

Like my laptop connected to wifi, first time very slow.
At same time, phone on SIM netpack also loading slowly(animation of loading, no content).

Then once the site loaded on pc, immediately it loaded on mobile. Even though they have diff ISP.

I am hosting in US-EAST, accessing from India

Linux Web App (PHP 7)(US-EAST) <----> MySQL Flexible Server (US-EAST)

I have also enabled HTTPS only, this also improves web app speed, when clients connect to HTTPS only.

This is a project demo, so I am using the basic free tier web app.

Azure DNS
Azure DNS
An Azure service that enables hosting Domain Name System (DNS) domains in Azure.
774 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
8,960 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Sreeju Nair 12,666 Reputation points
    2022-03-05T07:14:29.457+00:00

    You need to check the Always on settings for you app.

    By default, Azure Web Apps are unloaded if they are idle (No request for the app) for a set period of time (20 minutes). This way, the system can conserve resources. The unloaded app can cause high latency for new requests because of its warm-up time.

    When Always On is turned on, the front-end load balancer sends a GET request to the application root every five minutes. The continuous ping prevents the app from being unloaded.

    Refer: https://learn.microsoft.com/en-us/azure/app-service/configure-common?tabs=portal#configure-general-settings

    1 person found this answer helpful.

  2. Nakshatra Nag 1 Reputation point
    2022-03-05T10:41:37.433+00:00

    Also I was getting 502 & App service error, even when it was working okay since 28 Feb.

    So I thought of upscaling it from Free to B1, now everything loads fast.

    Like even if it was working, certain PHP webpages were taking time to load (even after warm up) & SCM Management also was not working (sitename.scm.azurewebsites.net).

    Also investigating the logs I found that it was rebooted automatically at morning & noon. This happens only when Azure is doing maintainence, or server was malfunctioning...
    So I thought def it looks like performance issues and upscaled it.

    Its very simple thing with HTML CSS PHP & MySQL, idk why the free one was throwing errors even after restart.

    Today only these problems started happening.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.