[CENTOS] optimize limit file php‐fpm - fourslickz/notes GitHub Wiki
- Tentukan User PHP-FPM
ps -eo user,comm | grep php-fpm
- Cek Limit Saat Ini
cat /proc/$(pgrep -o php-fpm)/limits | grep "Max open files"
- Set Limit di Systemd (php74-php-fpm)
mkdir -p /etc/systemd/system/php74-php-fpm.service.d
nano /etc/systemd/system/php74-php-fpm.service.d/override.conf
[Service]
LimitNOFILE=65535
- reload systemd:
systemctl daemon-reload
- Set Limit untuk User PHP-FPM (nginx)
nano /etc/security/limits.conf
nginx soft nofile 65535
nginx hard nofile 65535
- Reload Systemd & Restart PHP-FPM
systemctl daemon-reload
systemctl restart php74-php-fpm
- Verifikasi Limit Baru
cat /proc/$(pgrep -o php-fpm)/limits | grep "Max open files"