Why is my Apache2 server with PHP-FPM experiencing significantly lower performance on AWS EC2 instances compared to DigitalOcean Droplets? Despite similar hardware specifications and configurations, the server on AWS is showing higher latency and lower throughput. Is there something in the network or configuration that could be causing this discrepancy?
When migrating to AWS EC2 I configured the servers on a clean fresh install of Amazon Linux 2 AMI
kernel on t3a.micro
(even better hardware than the one I was using on DigitalOcean) instance type. These new EC2 instances are geographically closer to my company's HQ, and therefore there should be less network latency.
I've tried changing Apache's MPM on AWS from prefork
to event
as well as tweaking PHP FPM's settings (process manager's number of child processes and so on) but still didn't notice a performance improvement. It takes way too much to load the pages and it seems that the server responds in a sequential manner (this didn't happen before migrating to AWS).