How to review PHP-FPM processes per account Print

  • 0

Introduction

When troubleshooting PHP-FPM, it may be required to determine how many processes are active for an account. You can use this procedure to determine if an account is using the max children for PHP-FPM pools.

 

Procedure

Log in to the SSH/Terminal as the root user. After successfully logged in, run the below commands to gather information about the processes.

To view the PHP-FPM processes of any account:  

( Note: replace $cPusername with your account username )

ps -f -U $cPusername |grep "[p]hp-fpm"

To count the PHP-FPM processes of any account: 

( Note: replace $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 count 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 -c "[p]hp-fpm";done

If you have a more specific issue with PHP-FPM processes, it would be best to review the article below for tuning PHP-FPM.

PHP-FPM Performance Tuning Basics


Was this answer helpful?
Back

Send Message