I own a pretty simple WebApp, based on php/mysql/redis/nginx.
I was trying to move the server to Azure, to see if I could save some money, and today I created a WebApp on Azure using the wizard UI of it.
The first issue I noticed is that the Web API calls faced a huge increase in response time, compared to AWS hosting, even for a single ping. I decided to benchmark code execution time and network time (on browser), with multiple tests:
A simple request with no Database queries or any Redis connection took:
- AWS (*******.eu-central-1.elasticbeanstalk.com/ping) 400ms (code exec 379ms)
- Azure (********.azurewebsites.net/ping) 1.6s (code exec 329Ms)
Cloud configurations are as following:
AWS:
- Region: EU-Central (Frankfurt)
- EC2: t3.micro
- Amazon linux
- Nginx
Azure:
- Region: West Germany Central
- WebApp Instance: Premium General purpose 8Gb Ram, 4CPU (I tried different combination but it did not help)
- Linux (cannot recall which)
- Nginx
I tried searching and changing configurations, but I was not able to have the same network response, Azure resulted always slow, mediumly over the 1.3 seconds per request, while AWS was always around 500ms per request.
The full web app uses API Gateway and Redis to cache in front of MySQL, but the connection to those impacted almost nothing on the total code execution (20ms more or less).
Why there is such a difference, is that something I am missing in the setup?