Last active
November 24, 2015 05:33
-
-
Save yevrah/1b19171c8eb4483bc71d to your computer and use it in GitHub Desktop.
Apache: Mem Summary
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
#!/bin/bash | |
printf "\nMemory Status\n" | |
ps aux | grep '^apache' | awk '{print $1, $2, $11, $6/1024 " MB";}' | |
printf "\nSum: " | |
ps aux | grep '^apache' | awk '{sum+= $6;} END {print sum/1024 " MB";}' | |
printf "Average: " | |
ps aux | grep '^apache' | awk '{print $6/1024;}' | awk '{avg += ($1 - avg) / NR;} END {print avg " MB";}' | |
printf "Total Processes: " | |
ps aux | grep 'httpd' | awk '{sum+= 1;} END {print sum;}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment