Linux 4 All

Best Linux tricks source

The following one-liner will display number of Apache PIDs and sort them after memory usage:

ps aux | awk '$11 ~ /httpd/ {c++; SUM +=$6; print $6/1024" MB, PID:", $2|"sort -rn| head"} END {print c" Total Apache Processes"} END {print SUM/1024" MB Total Memory"} END {print "Top 10 Memory users:"}'

X-Served-By Header arrow-right
Next post

arrow-left How to log client IP with Apache behind Load Balancer
Previous post

Leave a Reply

Your email address will not be published. Required fields are marked *