• Plesk Uservoice will be deprecated by October. Moving forward, all product feature requests and improvement suggestions will be managed through our new platform Plesk Productboard.
    To continue sharing your ideas and feedback, please visit features.plesk.com

Question Restarting Dedicated PHP-FPM for all the domains

WebHostingAce

Silver Pleskian
Server operating system version
AlmaLinux 8.10 (Cerulean Leopard)
Plesk version and microupdate number
Plesk Obsidian 18.0.71 Update #2
Hi,

I’m running about 40 domains in a single subscription, each configured to use Dedicated FPM application served by nginx.

My OPcache settings include:

Code:
opcache.revalidate_path = 0
opcache.validate_timestamps = 0
opcache.memory_consumption = 1024
opcache.interned_strings_buffer = 64
opcache.max_accelerated_files = 100000

realpath_cache_size = 10M
realpath_cache_size = 10240K

Because of these settings, after making website changes I need to restart the PHP-FPM processes for the domains to refresh OPcache and the realpath cache.

I tried:

systemctl restart plesk-php83-fpm

but this doesn’t affect domains using Dedicated FPM application served by nginx.

Currently my workaround is:

1. Change the “Service Plan” PHP setting to something other than “Dedicated FPM application served by nginx”.

2. Apply changes.

3. Switch back to “Dedicated FPM application served by nginx”, which restarts the dedicated PHP-FPM processes.

I also tried killing each domain’s PHP-FPM master process via a script, but in that case the processes did not auto-start on the next request.

Question:

What is the correct or recommended way in Plesk to restart all PHP-FPM processes for domains using Dedicated FPM application served by nginx, without having to switch the Service Plan setting?

Thanks in advance.
 
I think this will work for me.

Code:
#!/bin/bash
# Restart all PHP 8.3 Dedicated FPM services in Plesk

echo "Restarting all PHP 8.3 Dedicated FPM pools..."
systemctl list-units --type service --all \
  | grep -oE 'plesk-php83-fpm_[^ ]+' \
  | while read -r svc; do
      echo "Restarting $svc..."
      systemctl restart "$svc"
    done
echo "Done."

If there is any other way. Please let me know.

Thank you.
 
The same approach as above but without using a script:
Bash:
systemctl restart plesk-php83-fpm_*
 
Last edited:
Back
Top