Control Web Panel
WebPanel => Apache => Topic started by: Jeroen on January 12, 2022, 03:20:55 PM
-
Hi,
I'm currently setting up a CWP Pro server on a VPS with 16 dedicated processor cores.
I have been looking into how to best utilize the resources and mainly what i have come across is that MPM is apache's way to go for multithreading.
Before i start changing the config files i would like to ask what are best practices for setting up the server resources like CPU and RAM. Is MPM the way togo for CWP PRO?
Since MPM is turned off by default in httpd.conf
# Server-pool management (MPM specific)
#Include conf/extra/httpd-mpm.conf
Current setup is Nginx -> Apache -> PHP-FPM 7.xx
Besides Apache settings should i change any other settings to better utilize the resources?
Thanks in advance
-
(...)
Since MPM is turned off by default in httpd.conf
No. It's enabled the module "mpm_event".
Check with:
# /usr/local/apache/bin/apachectl -M | grep -i mpm
(...)
Current setup is Nginx -> Apache -> PHP-FPM 7.xx
Besides Apache settings should i change any other settings to better utilize the resources?
Thanks in advance
The MPM Event is needed to run PHP-FPM.
You can choose another MPM just with PHP-CGI.
It is a Apache module/PHP limitation.
Surely, PHP-FPM have a superior performance, included with Nginx<->Varnish<->Apache, but you can have different problems with greedy caching with Varnish.
Your choice.
-
superb, thx
Not using varnish for caching.
But surely i can modify the mpm_event config lines.
Any recommendations regarding the below lines?
<IfModule mpm_event_module>
StartServers
MinSpareThreads
MaxSpareThreads
ThreadsPerChild
MaxRequestWorkers
MaxConnectionsPerChild
</IfModule>
-
This is too much specific to your platform (memory available, speed machine, etc.) and profile of your users (heavy acessed? heavy memory use? etc).
It's literally impossible to suggest values to these parameters.
But you can start by the suggestion of this file:
/usr/local/apache/conf/extra/httpd-mpm.conf
# event MPM
# StartServers: initial number of server processes to start
# MinSpareThreads: minimum number of worker threads which are kept spare
# MaxSpareThreads: maximum number of worker threads which are kept spare
# ThreadsPerChild: constant number of worker threads in each server process
# MaxRequestWorkers: maximum number of worker threads
# MaxConnectionsPerChild: maximum number of connections a server process serves
# before terminating
<IfModule mpm_event_module>
StartServers 3
MinSpareThreads 75
MaxSpareThreads 250
ThreadsPerChild 25
MaxRequestWorkers 400
MaxConnectionsPerChild 0
</IfModule>
After trying the above values, you should fine-tune your configuration to the desired performance profile.