MPM-Event für Apache einrichten

Aus Glaskugel
Zur Navigation springen Zur Suche springen
1. Bearbeite die entsprechende Datei via SSH

mcedit /etc/httpd/conf.modules.d/00-mpm.conf

2. Kommentiere folgenden Eintrag durch Setzen einer Raute "#" aus und deaktiviere somit den Modus prefork
LoadModule mpm_prefork_module modules/mod_mpm_prefork.so
3. Aktiviere durch Entfernen der Raute vor diesem Eintrag den Modus "worker"
LoadModule mpm_worker_module modules/mod_mpm_worker.so
4. Ergänze die Folgenden Blöcke im unteren Bereich
<IfModule mpm_worker_module>
        StartServers                    8
        MinSpareThreads                 50
        MaxSpareThreads                 100
        ThreadLimit                     64
        ThreadsPerChild                 64
        MaxRequestWorkers               384
        MaxConnectionsPerChild          10000
        ServerLimit                     6
        GracefulShutdownTimeout         5
</IfModule> 
<IfModule mod_deflate.c>
        <IfModule mod_filter.c>
                # these are known to be safe with MSIE 6
                AddOutputFilterByType DEFLATE text/html text/plain text/xml

                # everything else may cause problems with MSIE 6
                AddOutputFilterByType DEFLATE text/css
                AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript
                AddOutputFilterByType DEFLATE application/rss+xml
                AddOutputFilterByType DEFLATE application/xml
        </IfModule>
</IfModule> 

Hinterher sieht die Datei dann so aus

# Select the MPM module which should be used by uncommenting exactly
# one of the following LoadModule lines:

# prefork MPM: Implements a non-threaded, pre-forking web server
# See: http://httpd.apache.org/docs/2.4/mod/prefork.html
# LoadModule mpm_prefork_module modules/mod_mpm_prefork.so

# worker MPM: Multi-Processing Module implementing a hybrid
# multi-threaded multi-process web server
# See: http://httpd.apache.org/docs/2.4/mod/worker.html
# 
LoadModule mpm_worker_module modules/mod_mpm_worker.so

# event MPM: A variant of the worker MPM with the goal of consuming
# threads only for connections with active processing
# See: http://httpd.apache.org/docs/2.4/mod/event.html
#
# LoadModule mpm_event_module modules/mod_mpm_event.so
<IfModule mpm_worker_module>
        StartServers                    8
        MinSpareThreads                 50
        MaxSpareThreads                 100
        ThreadLimit                     64
        ThreadsPerChild                 64
        MaxRequestWorkers               384
        MaxConnectionsPerChild          10000
        ServerLimit                     6
        GracefulShutdownTimeout         5
</IfModule>

<IfModule mod_deflate.c>
        <IfModule mod_filter.c>
                # these are known to be safe with MSIE 6
                AddOutputFilterByType DEFLATE text/html text/plain text/xml

                # everything else may cause problems with MSIE 6
                AddOutputFilterByType DEFLATE text/css
                AddOutputFilterByType DEFLATE application/x-javascript application/javascript application/ecmascript
                AddOutputFilterByType DEFLATE application/rss+xml
                AddOutputFilterByType DEFLATE application/xml
        </IfModule>
</IfModule>
5. Starte den Apache neu

service httpd restart

Außerdem interessant in Zusammenhang mit Apache Problemen

https://support.plesk.com/hc/en-us/articles/214529205-Apache-keeps-going-down-on-a-Plesk-server-server-reached-MaxRequestWorkers-setting
https://support.plesk.com/hc/en-us/articles/213399589-Websites-on-Plesk-server-are-slow-or-PHP-mail-cannot-be-sent-mod-fcgid-ap-pass-brigade-failed
https://support.plesk.com/hc/en-us/articles/213374769-Website-or-webmail-shows-500-internal-server-error-on-Plesk-mod-fcgid-read-data-timeout