Skip to content

Instantly share code, notes, and snippets.

@lepture
Created September 2, 2013 03:50
Show Gist options
  • Save lepture/6409076 to your computer and use it in GitHub Desktop.
Save lepture/6409076 to your computer and use it in GitHub Desktop.
SUBSTITUTE=`ps -A -o pid,rss,command | grep substitute | grep -v grep | awk '{total+=$2}END{printf("%d", total/1024)}'`
SUPERVISOR=`ps -A -o pid,rss,command | grep supervisord | grep -v grep | awk '{total+=$2}END{printf("%d", total/1024)}'`
GUNICORN=`ps -A -o pid,rss,command | grep gunicorn | grep -v grep | awk '{total+=$2}END{printf("%d", total/1024)}'`
MYSQL=`ps -A -o pid,rss,command | grep mysql | grep -v grep | awk '{total+=$2}END{printf("%d", total/1024)}'`
NGINX=`ps -A -o pid,rss,command | grep nginx | grep -v grep | awk '{total+=$2}END{printf("%d", total/1024)}'`
OTHER=`ps -A -o pid,rss,command | grep -v nginx | grep -v substitute | grep -v gunicorn | grep -v mysql | grep -v supervisord | grep -v grep | awk '{total+=$2}END{printf("%d", total/1024)}'`
printf "%-12s %3s MB\n" "Supervisor:" $SUPERVISOR
printf "%-12s %3s MB\n" "Substitute:" $SUBSTITUTE
printf "%-12s %3s MB\n" "Gunicorn:" $GUNICORN
printf "%-12s %3s MB\n" "Nginx:" $NGINX
printf "%-12s %3s MB\n" "MySQL:" $MYSQL
printf "%-12s %3s MB\n" "Other:" $OTHER
echo
free -m
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment