How to Analyse PHP-FPM Processes per Account

August 29, 2024 / How-to Guide

It may be necessary to analyse whether a particular account is reaching the maximum number of children for PHP-FPM pools when troubleshooting PHP-FPM. This is what you will discover in this article.

Procedure:

  1. Log in to SSH/Terminal as the root user.
  2. Once logged in, run the following commands to gather information about the processes:
    • To view the PHP-FPM processes associated with any account:
      ( Note: substitute $cPusername with your account username )
      ps -f -U $cPusername |grep “[p]hp-fpm”
    • To determine the number of PHP-FPM processes for any account:
      ( Note: substitute $cPusername with your account username )
      ps -f -U $cPusername|grep -c “[p]hp-fpm”
    • To view the PHP-FPM processes for all accounts:
      for user in `cat /etc/trueuserdomains|awk ‘{print $2}’`;
      do printf “User $user PHP-FPM processes:\n\n”;
      ps -f -U $user -u $user|grep “[p]hp-fpm”;done
    • To determine the number of PHP-FPM processes for all accounts:
      for user in `cat /etc/trueuserdomains|awk ‘{print $2}’`;
      do printf “User $user PHP-FPM processes:\n\n”;
      ps -f -U $user -u $user|grep -c “[p]hp-fpm”;done

That is it! Hope you liked our article. If you run into any difficulty, feel free to contact our technical team at any problematic instant.