On my Archlinux box I want to limit some applications to a smaller amount of memory using cgroups. Since I use swap, I need to account memory+swap. How can I enable swap accounting?
2 Answers
Arch Linux' kernel has the swap accounting disabled by default (cf. the kernel config file). You can enable it by booting with swapaccount=1
in your kernel cmdline (cf. the kernels Kconfig documentation.
Also you can edit
/etc/default/grub
and replace the line
GRUB_CMDLINE_LINUX=""
by
GRUB_CMDLINE_LINUX="swapaccount=1"
Then run update-grub [optional], and reboot the server.
find more tricks in http://kencochrane.net/blog/2013/08/the-docker-guidebook/#remove-all-docker-images
memory.memsw.limit_in_bytes # set/show limit of memory+Swap usage
- does this not work for you?