fastcgi - Why does PHP-FPM take 5 minutes to restart on my server? -
i using php-fpm default settings. server running latest arch linux.
i issue command sudo systemctl restart php-fpm
, takes 5 minutes restart , prompt.
is there known solution problem?
this caused way systemctl script php-fpm created. had exact same problem. here how i've resolved it.
first find start-up script, if don't know can systemctl status php-fpm
, you'll see like: /etc/systemd/system/php.service
now edit file , should this:
[unit] description=the php fastcgi process manager after=syslog.target network.target [service] type=notify pidfile=/run/php-fpm/php-fpm.pid privatetmp=true execstart=/usr/bin/php-fpm --nodaemonize --pid /run/php-fpm/php-fpm.pid execreload=/bin/kill -usr2 $mainpid [install] wantedby=multi-user.target
change this:
[unit] description=the php fastcgi process manager after=syslog.target network.target [service] execstart=/usr/bin/php-fpm --nodaemonize execreload=/bin/kill -hup $mainpid restart=always [install] wantedby=multi-user.target
one file changed run command refresh systemctl -> systemctl daemon-reload
now restart fpm. i'd recommend shutdown fpm first before making changes file. once changes made fpm start/stop/restart instantly.
now don't know why of yet, after i've made change appear fpm still takes forever start/stop/restart. went ahead , rebooted machine , on instant. i'm guessing hanging haven't found yet reboot resolved that. know shouldn't have reboot, until can find it's hanging did trick now.
Comments
Post a Comment