Here is one liner which gives you average memory consumption of php-fpm processes.
ps --no-headers -o "rss,cmd" -C "php-fpm" | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'
If you have more pools, you can grep for specific pool and get average for that one:
ps --no-headers -o "rss,cmd" -C "php-fpm" | grep <mypool2> | awk '{ sum+=$1 } END { printf ("%d%s\n", sum/NR/1024,"M") }'
Recent Comments