Skip to content

Instantly share code, notes, and snippets.

@lanefu
Created March 12, 2019 18:27
Show Gist options
  • Save lanefu/c984c8d7bf19a772b690d9f5b8a585f9 to your computer and use it in GitHub Desktop.
Save lanefu/c984c8d7bf19a772b690d9f5b8a585f9 to your computer and use it in GitHub Desktop.
watch cgroup memory
#!/bin/bash
cd /sys/fs/cgroup/memory
while [[ /bin/true ]];do
date
for item in $(ls memory.*usage*); do echo $item $(echo echo $(echo $(cat $item) /1024/1024 |bc))M;done
echo "container count $(docker ps -a|wc -l)"
echo
sleep 10s
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment