Skip to content

Added NUMA detection and configure mongodb to work correctly using NUMA#294

Open
Madias2222 wants to merge 3 commits intoitential:devfrom
Madias2222:dev
Open

Added NUMA detection and configure mongodb to work correctly using NUMA#294
Madias2222 wants to merge 3 commits intoitential:devfrom
Madias2222:dev

Conversation

@Madias2222
Copy link
Contributor

Added NUMA detection and configure mongodb to work correctly using NUMA

Comment on lines 87 to 99
- name: Configure mongod to run with numactl interleave
ansible.builtin.copy:
dest: /etc/systemd/system/mongod.service.d/numa.conf
mode: "0644"
content: |
[Service]
ExecStart=
ExecStart={{ mongodb_numactl_path }} --interleave=all {{ mongodb_mongod_path }} --config {{ mongodb_conf_file }}
register: mongodb_numa_dropin
when:
- mongodb_numa_enabled
- mongodb_numactl_present
become: true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we use a template here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When we talk about systemd template is never a good choice, if Mongo Team update the systemd file our template is obsolete. Learning about systemd this is te correct way to override parameters in systemd.

This will guarantee that if the vendor make any update in the systemd file we are being updated with the latest vendor recommendation and not break our stuff

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are using the copy module. So you are creating the file with the content, not updating an exiting file.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, I need to create a file with the content that I want to override, because that I'm using copy

ansible.builtin.package:
name: numactl
state: present
when: mongodb_numa_enabled
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use a block since when: mongodb_num_enabled is used for multiple tasks.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't understand this :-)

Removed unnecessary 'become: true' directives from various tasks in the configure-mongodb-numa.yml file.
Copy link
Contributor Author

@Madias2222 Madias2222 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed the become

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants