-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: stafaniasaju <[email protected]>
- Loading branch information
1 parent
ff0055d
commit 8e522b9
Showing
2 changed files
with
71 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
--- | ||
# Ensure RFS configuration persists | ||
- name: Configure RFS with 32768 | ||
hosts: all | ||
become: yes | ||
tasks: | ||
- name: Update rps_sock_flow_entries runtime value | ||
ansible.builtin.shell: sysctl -w net.core.rps_sock_flow_entries=32768 | ||
changed_when: false | ||
|
||
- name: Persist rps_sock_flow_entries in sysctl.conf | ||
lineinfile: | ||
path: /etc/sysctl.conf | ||
regexp: '^net.core.rps_sock_flow_entries' | ||
line: 'net.core.rps_sock_flow_entries=32768' | ||
|
||
- name: Reload sysctl configuration | ||
ansible.builtin.shell: sysctl -p | ||
|
||
- name: Create custom systemd unit for RFS configuration | ||
copy: | ||
dest: /etc/systemd/system/rfs-config.service | ||
content: | | ||
[Unit] | ||
Description=Set RPS flow control settings | ||
After=network-online.target | ||
Wants=network-online.target | ||
[Service] | ||
Type=oneshot | ||
ExecStart=/bin/bash -c "sleep 5; for file in $(find /sys/class/net/*/queues/ -name 'rx-*' | grep -v '/lo/'); do echo 32768 > $file/rps_flow_cnt; done" | ||
[Install] | ||
WantedBy=multi-user.target | ||
- name: Reload systemd manager configuration | ||
ansible.builtin.shell: systemctl daemon-reload | ||
|
||
- name: Enable and start RFS configuration service | ||
systemd: | ||
name: rfs-config.service | ||
enabled: yes | ||
state: restarted | ||
|
||
- name: Verify sysctl value after service start | ||
ansible.builtin.shell: sysctl net.core.rps_sock_flow_entries | ||
register: sysctl_value | ||
|
||
- name: Debug sysctl value | ||
debug: | ||
var: sysctl_value.stdout | ||
|
||
- name: Verify RFS runtime configuration | ||
ansible.builtin.shell: | | ||
find /sys/class/net/*/queues/ -name 'rx-*' | grep -v '/lo/' | xargs -I{} cat {}/rps_flow_cnt | ||
register: rfs_runtime_values | ||
|
||
- name: Debug RFS runtime values | ||
debug: | ||
var: rfs_runtime_values.stdout_lines |