Make NUMA optional

This commit is contained in:
Nicolas Boutet 2020-01-10 15:31:31 +01:00
parent e3b6b7577f
commit 4074743f18
6 changed files with 12 additions and 0 deletions

View File

@ -48,6 +48,9 @@ mongodb_manage_systemd_unit: true
# Disable transparent hugepages on systemd debian based installations
mongodb_disable_transparent_hugepages: false
# You can enable or disable NUMA support
mongodb_use_numa: true
mongodb_user: "{{ 'mongod' if ('RedHat' == ansible_os_family) else 'mongodb' }}"
mongodb_uid:
mongodb_gid:

View File

@ -21,6 +21,8 @@ mongodb_systemd_unit_limit_nproc: 64000
mongodb_disable_transparent_hugepages: false
mongodb_use_numa: true
mongodb_user: "{{ 'mongod' if ('RedHat' == ansible_os_family) else 'mongodb' }}"
mongodb_uid:
mongodb_gid:

View File

@ -24,6 +24,7 @@
name: numactl
state: present
lock_timeout: "{{ yum_lock_timeout }}"
when: mongodb_use_numa | bool
- name: Install PyMongo package
yum:

View File

@ -57,6 +57,7 @@
apt:
name: numactl
state: present
when: mongodb_use_numa | bool
- name: Add systemd configuration if present
template:

View File

@ -30,6 +30,7 @@
name: numactl
state: present
lock_timeout: "{{ yum_lock_timeout }}"
when: mongodb_use_numa | bool
- name: Install PyMongo package
yum:

View File

@ -5,7 +5,11 @@ Documentation=man:mongod(1)
[Service]
User={{ mongodb_user }}
{% if mongodb_use_numa | bool %}
ExecStart=/usr/bin/numactl --interleave=all /usr/bin/mongod --config /etc/mongod.conf
{% else %}
ExecStart=/usr/bin/mongod --config /etc/mongod.conf
{% endif %}
# file size
LimitFSIZE=infinity
# cpu time