I have created a docker container with the following
OS: Debian 11
WebServer: httpd2.4 (Enabled mpm_event)
Backend: PHP-FPM
Docker is running in EC2 and I have given 10GB RAM and 5CPU for the docker container.
Everything is working on the UI and my application is good. Now I'm looking forward to optimizing the server to increase the simultaneous requests and performance.
So, what I have done is
httpd.conf (/usr/local/apache2/conf/httpd.conf)
Enabled the mpm_event module and commented on the mpm_prefork and mpm_worker modules.
Added the following configuration
<IfModule mpm_event_module>
ServerLimit 256
StartServers 125
MinSpareThreads 100
MaxSpareThreads 150
ThreadLimit 64
ThreadsPerChild 25
MaxRequestWorkers 2000
MaxConnectionsPerChild 10000
</IfModule>
PHP-FPM configuration
pm = dynamic
pm.max_children = 256
pm.start_servers = 125
pm.min_spare_servers = 100
pm.max_spare_servers = 150
pm.max_requests = 1000
m.max_spawn_rate = 100
When I try to check the load testing with apache benchmark `ab -n 500 -c 100 "http://localhost/test.php" takes 35s to load.
Before the mpm_event module, I used prefork and I got the response in 16s. Not sure what I'm missing