Increase Apache process count?

unity200

Member
Nov 16, 2006
21
3
153
1 - Im trying to optimize Apache on centos 7 and trying to increase Apache processes and threads while using event mpm, but its practically being ignored by cpanel:

I tried editing

/usr/local/apache/conf/includes/post_virtualhost_global.conf

both directly and through WHM apache configuration editor.

Doesnt seem to have any effect.

Then i tried to change the values in

WHM ==> Service Configuration ==> Apache Configuration ==> Global Configuration

This seem to have had some effect but it was only increasing processes from 8 or something to 10 or something despite i put in a few hundred. Moreover these values seem to be for mpm worker?

I am trying to change these values via proper WHM ways instead of directly editing the config files.

So if someone can point me in a proper direction, i would appreciate it.

2- Is there a limit which cpanel imposes on accounts regarding apache process usage? Ie, accounts can use maximum 6 apache processes and 10 php-fpm processes or something?

Because however i increase the values and benchmark a site with apache benchmark, the requests/sec fulfilled always stays in the same vicinity and does not change depending on the limits i increase in apache.
 

cPanelLauren

Forums Analyst II
Staff member
Nov 14, 2017
8,012
647
263
Houston
cPanel Access Level
DataCenter Provider
WHM ==> Service Configuration ==> Apache Configuration ==> Global Configuration
This seem to have had some effect but it was only increasing processes from 8 or something to 10 or something despite i put in a few hundred. Moreover these values seem to be for mpm worker?
This is the correct location to make these changes but you do need to keep in mind the following when modifying the ServerLimit vaues mpm_common - Apache HTTP Server Version 2.4
For threaded and hybrid servers (e.g. event or worker) MaxRequestWorkers restricts the total number of threads that will be available to serve clients. For hybrid MPMs the default value is 16 (ServerLimit) multiplied by the value of 25(ThreadsPerChild). Therefore, to increase MaxRequestWorkers to a value that requires more than 16 processes, you must also raise ServerLimit.
This will also be noted in the apache error log after apache restarts if it's configured incorrectly.


2- Is there a limit which cpanel imposes on accounts regarding apache process usage? Ie, accounts can use maximum 6 apache processes and 10 php-fpm processes or something?
We don't impose a limit of this type. There are some hard limits imposed with event which are detailed in the apache 2.4 docs:

mpm_common - Apache HTTP Server Version 2.4
Code:
There is a hard limit of ThreadLimit 20000 (or ThreadLimit 100000 with event, ThreadLimit 15000 with mpm_winnt) compiled into the server. This is intended to avoid nasty effects caused by typos. To increase it even further past this limit, you will need to modify the value of MAX_THREAD_LIMIT in the mpm source file and rebuild the server.
There are also pool defaults for PHP-FPM that you may want to look at as well. You can modify these values at WHM>>Software>>MultiPHP Manager -> System PHP-FPM Configuration
 
  • Like
Reactions: unity200