Our mobile APIs were hosted in AWS EC2 instance and it was working very fast, say 300 ms. Recently we migrated to Azure VM and after that, all the API responses are very slow, say 2 to 8 secs.
The structure is below.
- AWS EC2 instance size is 4 CPUs, 16GM RAM (t3.xlarge)
- Azure VM is (Ds3v2) 4 CPUs, 16GM RAM
- Program is built on Lumen framework (PHP), connected to Mysql
After discussing with Azure tech support, they suggest to upgrade the instance to F-series and I've done that too. But still I am facing this performance issue.
This can happen for a variety of reasons, not necessarily VM related. The best way to find this out is to add logging / profiling to your app, so you can see where, exactly, is the bottleneck. I would add logging, at least:
In addition - did you look at the machine's metric? What's the CPU and RAM utilization?