Use "ceph_tcmalloc_max_total_thread_cache" to set the
TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES value inside /etc/default/ceph for
Debian installs, or /etc/sysconfig/ceph for Red Hat/CentOS installs.
By default this is set to 0, so the default package value will be used,
if specified this value will be changed to match the variable, and ceph
osd services will be restarted.
(cherry picked from commit
7f6c39102d4fc1c9ec987fe3dd06693a94ad56fb)
Signed-off-by: Sébastien Han <seb@redhat.com>
# - { name: vm.swappiness, value: 10 }
# - { name: vm.min_free_kbytes, value: "{{ vm_min_free_kbytes }}" }
+# For Debian & Red Hat/CentOS installs set TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES
+# Set this to a byte value (e.g. 134217728)
+# A value of 0 will leave the package default.
+#ceph_tcmalloc_max_total_thread_cache: 0
+
##########
# DOCKER #
# - { name: vm.swappiness, value: 10 }
# - { name: vm.min_free_kbytes, value: "{{ vm_min_free_kbytes }}" }
+# For Debian & Red Hat/CentOS installs set TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES
+# Set this to a byte value (e.g. 134217728)
+# A value of 0 will leave the package default.
+#ceph_tcmalloc_max_total_thread_cache: 0
+
##########
# DOCKER #
--- /dev/null
+---
+- name: configure TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES for debian
+ lineinfile:
+ dest: "{{ etc_default_ceph.stat.isdir | ternary('/etc/default/ceph/ceph', '/etc/default/ceph') }}"
+ insertafter: EOF
+ create: yes
+ regexp: "^TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES="
+ line: "TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES={{ ceph_tcmalloc_max_total_thread_cache }}"
+ when:
+ - ansible_os_family == 'Debian'
+ - etc_default_ceph.stat.exists
+ notify:
+ - restart ceph osds
+
+- name: configure TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES for redhat
+ lineinfile:
+ dest: "/etc/sysconfig/ceph"
+ insertafter: EOF
+ create: yes
+ regexp: "^TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES="
+ line: "TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES={{ ceph_tcmalloc_max_total_thread_cache }}"
+ when:
+ - ansible_os_family == 'RedHat'
+ notify:
+ - restart ceph osds
- name: include configure_cluster_name.yml
include: configure_cluster_name.yml
+
+- name: include configure_memory_allocator.yml
+ include: configure_memory_allocator.yml
+ when:
+ - (ceph_tcmalloc_max_total_thread_cache | int) > 0
+ - osd_objectstore == 'filestore'
+ - (ceph_origin == 'repository' or ceph_origin == 'distro')
- { name: vm.swappiness, value: 10 }
- { name: vm.min_free_kbytes, value: "{{ vm_min_free_kbytes }}" }
+# For Debian & Red Hat/CentOS installs set TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES
+# Set this to a byte value (e.g. 134217728)
+# A value of 0 will leave the package default.
+ceph_tcmalloc_max_total_thread_cache: 0
+
##########
# DOCKER #
{% endif -%}
-e CLUSTER={{ cluster }} \
-e OSD_DEVICE=/dev/${1} \
+ {% if (ceph_tcmalloc_max_total_thread_cache | int) > 0 and osd_objectstore == 'filestore' -%}
+ -e TCMALLOC_MAX_TOTAL_THREAD_CACHE_BYTES={{ ceph_tcmalloc_max_total_thread_cache }} \
+ {% endif -%}
-e CEPH_DAEMON=OSD_CEPH_DISK_ACTIVATE \
{{ ceph_osd_docker_extra_env }} \
--name=ceph-osd-{{ ansible_hostname }}-${1} \