↑ ↓ select, Enter open, Esc close

Count PHP-FPM processes per pool

user@server
ps -eo args | grep '[p]hp-fpm: pool' | awk '{print $NF}' | sort | uniq -c | sort -rn

Reads the process names of all PHP-FPM workers that match the pattern php-fpm: pool <name> and counts them per pool. On Plesk, the pool name matches the domain. If a pool is constantly at its pm.max_children limit, requests have to wait and the site becomes slow.

Note: The warning server reached pm.max_children setting appears in the FPM log of the respective PHP version.

Also searched as

  • which site is causing high load
  • php-fpm max_children reached
  • too many php processes

Related one-liners

All in PHP

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.