Created
June 7, 2018 17:48
-
-
Save 24HOURSMEDIA/c4baa35dba727cd8f03412e5de02fcba to your computer and use it in GitHub Desktop.
get php-fpm memory usage in linux
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
``` | |
user='USER' | |
pname='php-fpm' | |
# get total memory usage of php-fpm | |
ps -U $user --no-headers -o rss -o command | grep $pname | awk '{ sum+=$1} END {print int(sum/1024) "MB"}' | |
# get total number of php-fpm processes + 1 | |
ps aux | grep $pname | wc -l | |
``` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment