Last active
August 29, 2015 14:20
-
-
Save nshenry03/90d68840f9ecdea80c80 to your computer and use it in GitHub Desktop.
Get a summary of per process memory usage using awk (php-fpm for example). Note, if a process shares libraries, they will be counted multiple times so this isn't perfect; however, it should give you a good rough summary of the amount of memory used.
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
ps aux | fgrep php-fpm | egrep -v 'master process|fgrep' | sort -k13 | awk '{print $1,$6}' | awk '{a[$1]+=$2;}END{for(i in a)print i, a[i] * 0.001;}' | sort -nr -k2 | awk '{ sum+=$2 ; print $1, $2, " MB"} END {print "Total Memory Usage:", sum, " MB"}' |
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
lilnbboj 268.368 MB | |
zkrmkprl 221.532 MB | |
yfjoubng 212.532 MB | |
rjnjpbqg 209.78 MB | |
dvpqmqss 141.96 MB | |
paxsqasd 130.288 MB | |
lgtuwbau 118.284 MB | |
bgougjoq 117.36 MB | |
mhffauvt 30.292 MB | |
wxsdlnag 30.28 MB | |
tillfpoo 30.28 MB | |
bbsahigr 18.18 MB | |
ariorpev 18.168 MB | |
ulzmupsw 18.16 MB | |
uxtodijm 18.156 MB | |
njqugpvs 18.156 MB | |
mvldssjn 18.156 MB | |
dzhsazkm 18.152 MB | |
wuruxrrn 18.144 MB | |
goulhkdr 18.144 MB | |
xhhlhxag 18.132 MB | |
ujepetxu 18.132 MB | |
rtagkhxk 18.124 MB | |
Total Memory Usage: 1728.76 MB |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment