From c246d8dc806f7b9a713b30010e436fac5a79ad71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Thu, 15 Jan 2015 11:42:51 +0100 Subject: [PATCH] Ability to disable swap MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit With enough memory we will probably not need any swap. Signed-off-by: Sébastien Han --- roles/ceph-common/defaults/main.yml | 1 + roles/ceph-common/tasks/os_tuning.yml | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/roles/ceph-common/defaults/main.yml b/roles/ceph-common/defaults/main.yml index 40733433c..5f4741237 100644 --- a/roles/ceph-common/defaults/main.yml +++ b/roles/ceph-common/defaults/main.yml @@ -124,6 +124,7 @@ radosgw: false # referenced in monitor role too. ########### disable_transparent_hugepage: true +disable_swap: true os_tuning_params: - { name: kernel.pid_max, value: 4194303 } - { name: fs.file-max, value: 26234859 } diff --git a/roles/ceph-common/tasks/os_tuning.yml b/roles/ceph-common/tasks/os_tuning.yml index f920882c5..7bf05f4f5 100644 --- a/roles/ceph-common/tasks/os_tuning.yml +++ b/roles/ceph-common/tasks/os_tuning.yml @@ -5,8 +5,13 @@ - name: Disable transparent hugepage command: "echo never > /sys/kernel/mm/transparent_hugepage/enabled" - ignore_errors: true when: disable_transparent_hugepage + ignore_errors: true + +- name: Disable swap + command: swapoff -a + when: disable_swap + ignore_errors: true - name: Apply OS tuning sysctl: >