[CENTOS] optimize limit file php‐fpm - fourslickz/notes GitHub Wiki

  1. Tentukan User PHP-FPM
ps -eo user,comm | grep php-fpm
  1. Cek Limit Saat Ini
cat /proc/$(pgrep -o php-fpm)/limits | grep "Max open files"
  1. 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
  1. reload systemd:
systemctl daemon-reload
  1. Set Limit untuk User PHP-FPM (nginx)
nano /etc/security/limits.conf
nginx soft nofile 65535
nginx hard nofile 65535
  1. Reload Systemd & Restart PHP-FPM
systemctl daemon-reload
systemctl restart php74-php-fpm
  1. Verifikasi Limit Baru
cat /proc/$(pgrep -o php-fpm)/limits | grep "Max open files"