New in CWP Edge-LatestFree with every CWPpro licenceWebsites up to 300x faster

CWP now includes LSPHP, LSCache and CWP CageFS at no extra cost with all CWPpro licences. The LSCache plugin is integrated into our WordPress and other script installers, and CWP CageFS gives every user complete isolation. Available now in the CWP Edge-Latest version.

Get CWPpro ›

Performance

Started by Jeroen, January 12, 2022, 03:20:55 PM

Previous topic - Next topic

Jeroen

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

Netino

#1
Quote from: Jeroen on January 12, 2022, 03:20:55 PM
(...)
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


Quote
(...)
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.

Jeroen

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>

Netino

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.