source: main/waeup-ansible/files/swap_accounting.cfg @ 16770

Last change on this file since 16770 was 13995, checked in by uli, 8 years ago

Add roles to enable swap-accounting.

Swap accounting is at least used widely with docker
containers and managed by kernel cgroups. We might be
able, however to use it in regular production (w/o any
dockers).

To enable swap-accounting, respective settings must
be enabled in kernel during boot time. They are normally
disabled on Ubuntu.

We use the (as we think) proper mechanism to add
respective cmdline args in grub config.

Of course thses settings take effect only after reboot.

File size: 440 bytes
Line 
1# Enable swap accounting, to be placed in /etc/default/grub.d/
2# Afterwards `update-grub` and reboot must be run/done.
3# Script from ulif, based on dmraid2mdadm.cfg from stock ubuntu.
4SWAPACCOUNTING_TOAPPEND="cgroup_enable=memory swapaccount=1"
5
6case "$GRUB_CMDLINE_LINUX_DEFAULT" in
7    *$SWAPACCOUNTING_TOAPPEND*)
8        ;;
9    *)
10        GRUB_CMDLINE_LINUX_DEFAULT="$GRUB_CMDLINE_LINUX_DEFAULT $SWAPACCOUNTING_TOAPPEND"
11        ;;
12esac
Note: See TracBrowser for help on using the repository browser.