I have a cloud-based application written in PHP 5.6. It is a supermarket application that has traffic in some specific hours. In those peak hours, when large traffic hits across multiple supermarkets, the processing slows down among all the supermarkets.
I am using AWS EC2 and the application is running with a load balancer. There are 4 instances under the load balancer. I have tried to increase the no. of instances but still facing the slowness issue in those peak hours. I have also tried to change the category of the instance to a higher no. of CPUs but that didn't resolve the issue of slowness as well. I assume the PHP is single-threaded and due to this reason, increasing the CPUs might not have worked.
The web server is apache and PHP is being used as a module of Apache as in the following image: phpinfo
It will be a great favor if someone can advise with the solutions to handle these issues.