Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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