Author Topic: Performance  (Read 3695 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Performance
« 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

Code: [Select]
# 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

Offline
***
Re: Performance
« Reply #1 on: January 12, 2022, 09:17:21 PM »
(...)
Since MPM is turned off by default in httpd.conf

No. It's enabled the module "mpm_event".

Check with:
Code: [Select]
# /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.
« Last Edit: January 12, 2022, 09:21:37 PM by Netino »

Offline
*
Re: Performance
« Reply #2 on: January 12, 2022, 10:57:05 PM »
superb, thx

Not using varnish for caching.
But  surely i can modify the mpm_event config lines.
Any recommendations regarding the below lines?
Code: [Select]
<IfModule mpm_event_module>
    StartServers             
    MinSpareThreads         
    MaxSpareThreads       
    ThreadsPerChild       
    MaxRequestWorkers     
    MaxConnectionsPerChild   
</IfModule>

Offline
***
Re: Performance
« Reply #3 on: January 13, 2022, 08:38:40 PM »
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

Code: [Select]
# 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.