Konfigurasi MPM Event Apache
Setup Apache ke MPM Event + PHP-FPM
1️⃣ Cek MPM Apache yang aktif
apachectl -V | grep -i mpm
-
mpm_prefork❌ → harus diganti -
mpm_event✅ → sudah benar
2️⃣ Nonaktifkan MPM Prefork dan PHP 8.1
sudo a2dismod mpm_prefork
sudo a2dismod php8.1
3️⃣ Aktifkan MPM Event
sudo a2enmod mpm_event
4️⃣ Aktifkan Integrasi Apache ↔ PHP-FPM
sudo a2enmod proxy_fcgi setenvif
sudo a2enconf php8.1-fpm
5️⃣ Restart Apache & PHP-FPM
sudo systemctl restart php8.1-fpm
sudo systemctl restart apache2
6️⃣ Pastikan MPM Event Aktif
apachectl -V | grep -i mpm
Output harus:
Server MPM: event
7️⃣ Optimasi untuk Server Ram Besar
sudo nano /etc/apache2/mods-available/mpm_event.conf
<IfModule mpm_event_module>
StartServers 2
MinSpareThreads 25
MaxSpareThreads 75
ThreadLimit 64
ThreadsPerChild 25
MaxRequestWorkers 400
MaxConnectionsPerChild 5000
</IfModule>
sudo systemctl restart apache2