Skip to content

Instantly share code, notes, and snippets.

@ardabeyazoglu
Created October 6, 2018 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ardabeyazoglu/b8402e9d33104dfa91e397d6df411289 to your computer and use it in GitHub Desktop.
Save ardabeyazoglu/b8402e9d33104dfa91e397d6df411289 to your computer and use it in GitHub Desktop.
How to check php-fpm(fastcgi) memory usage?
```
# 5.6+
ps -ylC php-fpm5.6 | awk '{x += $8;y += 1} END {print "FPM Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'
ps -ylC php-fpm7.2 | awk '{x += $8;y += 1} END {print "FPM Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'
# older
ps -ylC php-fpm | awk '{x += $8;y += 1} END {print "FPM Memory Usage (MB): "x/1024; print "Average Proccess Size (MB): "x/((y-1)*1024)}'
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment