问题
I am using Amazon EC2 and apache 2.4, when I conduct stress tests, the httpd max processes is always 256
[ec2-user@xxxxxx]ps aux | grep httpd
259
httpd conf
<IfModule mpm_prefork_module>
StartServers 10
MinSpareServers 10
MaxSpareServers 64
ServerLimit 1600
MaxClients 1600
MaxRequestsPerChild 3000
</IfModule>
MPM conf
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
httpd -V
Server MPM: prefork
threaded: no
forked: yes (variable process count)
maybe I am missing something?
回答1:
Make sure that you are using MPM configuration after LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
line. Means remove MPM configuration form httpd.conf file and add in 00-mpm.conf file.
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
<IfModule mpm_prefork_module>
StartServers 10
MinSpareServers 10
MaxSpareServers 64
ServerLimit 1600
MaxClients 1600
MaxRequestsPerChild 3000
</IfModule>
来源:https://stackoverflow.com/questions/62206229/httpd-process-always-256