Skip to content

Instantly share code, notes, and snippets.

@phpdave
Last active April 20, 2017 15:55
Show Gist options
  • Select an option

  • Save phpdave/8ea588268f2b586c90fc4af9504f2f90 to your computer and use it in GitHub Desktop.

Select an option

Save phpdave/8ea588268f2b586c90fc4af9504f2f90 to your computer and use it in GitHub Desktop.
Apache Performance monitoring memory usage.
ps aux | grep 'httpd' | awk '{print $6/1024;}' | awk '{total += ($1) ;} END {print total " MB used by Apache Processes";}'
ps aux | grep 'httpd' | awk '{print $6/1024;}' | awk '{avg += ($1 - avg) / NR;} END {print avg " MB used on average per Apache process";}'
ps -C httpd --no-headers | wc -l | awk '{print $0 " apache processes ";}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment