Skip to content

Instantly share code, notes, and snippets.

@jpetazzo
Created December 3, 2013 19:58
Show Gist options
  • Save jpetazzo/7776421 to your computer and use it in GitHub Desktop.
Save jpetazzo/7776421 to your computer and use it in GitHub Desktop.
Example of memory cgroup information

Let's start a container:

root@dockerhost:~# docker run -d -i ubuntu bash
0d62d8b0dc65998b0dc5b88d4e2bd331f560579199f05869088ac98266dac0b1

Now let's check the cgroup values:

root@dockerhost:~# cat /sys/fs/cgroup/memory/lxc/0d62d8b0dc65998b0dc5b88d4e2bd331f560579199f05869088ac98266dac0b1/memory.stat 
cache 36864
rss 245760
mapped_file 0
pgpgin 299
pgpgout 230
pgfault 1425
pgmajfault 0
inactive_anon 16384
active_anon 253952
inactive_file 0
active_file 12288
unevictable 0
hierarchical_memory_limit 9223372036854775807
total_cache 36864
total_rss 245760
total_mapped_file 0
total_pgpgin 299
total_pgpgout 230
total_pgfault 1425
total_pgmajfault 0
total_inactive_anon 16384
total_active_anon 253952
total_inactive_file 0
total_active_file 12288
total_unevictable 0
root@dockerhost:~# 

All values are in bytes.

For more details, you can check http://jpetazzo.github.io/2013/10/08/docker-containers-metrics/ (shameless self-promo for my blog! :-))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment