From 3ae2a687ede1b0ad8d884e198c0f97bf0eb36fcf Mon Sep 17 00:00:00 2001 From: Dimitri Savineau Date: Fri, 5 Apr 2019 09:45:28 -0400 Subject: [PATCH] ceph-osd: Increase cpu limit to 4 In containerized deployment the default osd cpu quota is too low for production environment using NVMe devices. This is causing performance degradation compared to bare-metal. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1695880 Signed-off-by: Dimitri Savineau (cherry picked from commit c17106874c29f3eafb196a30b97fd1f8fd52e768) # Conflicts: # roles/ceph-osd/templates/ceph-osd-run.sh.j2 --- group_vars/osds.yml.sample | 2 +- roles/ceph-osd/defaults/main.yml | 2 +- roles/ceph-osd/templates/ceph-osd-run.sh.j2 | 8 +++++++- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/group_vars/osds.yml.sample b/group_vars/osds.yml.sample index 236a2e2be..937046793 100644 --- a/group_vars/osds.yml.sample +++ b/group_vars/osds.yml.sample @@ -237,7 +237,7 @@ dummy: # Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations # These options can be passed using the 'ceph_osd_docker_extra_env' variable. #ceph_osd_docker_memory_limit: "{{ ansible_memtotal_mb }}m" -#ceph_osd_docker_cpu_limit: 1 +#ceph_osd_docker_cpu_limit: 4 # The next two variables are undefined, and thus, unused by default. # If `lscpu | grep NUMA` returned the following: diff --git a/roles/ceph-osd/defaults/main.yml b/roles/ceph-osd/defaults/main.yml index 0f85a1511..e1bf915e3 100644 --- a/roles/ceph-osd/defaults/main.yml +++ b/roles/ceph-osd/defaults/main.yml @@ -229,7 +229,7 @@ ceph_config_keys: [] # DON'T TOUCH ME # Default values are based from: https://access.redhat.com/documentation/en-us/red_hat_ceph_storage/2/html/red_hat_ceph_storage_hardware_guide/minimum_recommendations # These options can be passed using the 'ceph_osd_docker_extra_env' variable. ceph_osd_docker_memory_limit: "{{ ansible_memtotal_mb }}m" -ceph_osd_docker_cpu_limit: 1 +ceph_osd_docker_cpu_limit: 4 # The next two variables are undefined, and thus, unused by default. # If `lscpu | grep NUMA` returned the following: diff --git a/roles/ceph-osd/templates/ceph-osd-run.sh.j2 b/roles/ceph-osd/templates/ceph-osd-run.sh.j2 index 8772b876e..768bccb80 100644 --- a/roles/ceph-osd/templates/ceph-osd-run.sh.j2 +++ b/roles/ceph-osd/templates/ceph-osd-run.sh.j2 @@ -69,6 +69,7 @@ fi ######## # MAIN # ######## +{% set cpu_limit = ansible_processor_vcpus|int if ceph_osd_docker_cpu_limit|int > ansible_processor_vcpus|int else ceph_osd_docker_cpu_limit|int %} {% if ceph_osd_numactl_opts != "" %} numactl \ @@ -83,10 +84,15 @@ numactl \ {% if osd_objectstore == 'filestore' -%} --memory={{ ceph_osd_docker_memory_limit }} \ {% endif -%} +<<<<<<< HEAD {% if ceph_docker_version.split('.')[0] is version_compare('13', '>=') -%} --cpus={{ ceph_osd_docker_cpu_limit }} \ +======= + {% if (container_binary == 'docker' and ceph_docker_version.split('.')[0] is version_compare('13', '>=')) or container_binary == 'podman' -%} + --cpus={{ cpu_limit }} \ +>>>>>>> c1710687... ceph-osd: Increase cpu limit to 4 {% else -%} - --cpu-quota={{ ceph_osd_docker_cpu_limit * 100000 }} \ + --cpu-quota={{ cpu_limit * 100000 }} \ {% endif -%} {% if ceph_osd_docker_cpuset_cpus is defined -%} --cpuset-cpus='{{ ceph_osd_docker_cpuset_cpus }}' \