Skip to content

Instantly share code, notes, and snippets.

@attilagyorffy
Created February 18, 2016 11:42
Show Gist options
  • Save attilagyorffy/d80e03c7089bc03530e6 to your computer and use it in GitHub Desktop.
Save attilagyorffy/d80e03c7089bc03530e6 to your computer and use it in GitHub Desktop.
Docker container total memory consumption
$ for line in `docker ps | awk '{print $1}' | grep -v CONTAINER`; do docker ps | grep $line | awk '{printf $NF" "}' && echo $(( `cat /sys/fs/cgroup/memory/docker/$line*/memory.usage_in_bytes` / 1024 / 1024 ))MB ; done
services_gitlab_1 912MB
services_redis_1 14MB
services_postgresql_1 58MB
services_ghost_1 165MB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment