I wish to launch apache so it forks one child process. (I'm profiling a module. I know about the -X flag,)
according to the docs
Two directives set hard limits on the number of active child processes and the number of server threads in a child process, and can only be changed by fully stopping the server and then starting it again. ServerLimit is a hard limit on the number of active child processes, and must be greater than or equal to the MaxClients directive divided by the ThreadsPerChild directive. ThreadLimit is a hard limit of the number of server threads, and must be greater than or equal to the ThreadsPerChild directive. If non-default values are specified for these directives, they should appear before other worker directives.
I tried setting my settings to:
<IfModule prefork.c>
StartServers 1
MinSpareServers 1
MaxSpareServers 1
ServerLimit 1
MaxClients 1
MaxRequestsPerChild 4000
</IfModule>
<IfModule worker.c>
StartServers 1
MaxClients 25
MinSpareThreads 25
MaxSpareThreads 25
ThreadsPerChild 25
MaxRequestsPerChild 0
</IfModule>
When I restart, I still get four processes.
root 17173 1 0 11:44 ? 00:00:00 /usr/sbin/httpd -k start
root 17205 17173 0 11:46 ? 00:00:00 /usr/sbin/httpd -k start
apache 17206 17173 0 11:46 ? 00:00:00 /usr/sbin/httpd -k start
apache 17207 17173 0 11:46 ? 00:00:00 /usr/sbin/httpd -k start
What am I doing wrong?
Oddly, if I use the -X flag, I still get three processes.
/usr/sbin/httpd -X -f /etc/httpd/conf/httpd.conf
apache 17224 4097 1 11:51 pts/1 00:00:00 /usr/sbin/httpd -X -f /etc/httpd/conf/httpd.conf
root 17226 17224 0 11:51 pts/1 00:00:00 /usr/sbin/httpd -X -f /etc/httpd/conf/httpd.conf
apache 17227 17224 0 11:51 pts/1 00:00:00 /usr/sbin/httpd -X -f /etc/httpd/conf/httpd.conf