diff options
author | Peter Mikus <pmikus@cisco.com> | 2022-08-17 13:57:23 +0000 |
---|---|---|
committer | Peter Mikus <peter.mikus@protonmail.ch> | 2022-08-19 05:01:23 +0000 |
commit | 0b947247146f27936e986c262fc9f1d641b5ac4f (patch) | |
tree | 141ee3f1a57b4c7287c0409b876d3fb96769c9cb /fdio.infra.ansible/roles/performance_tuning | |
parent | d92086e8ee964d2d5700046ef85c6b681844288a (diff) |
feat(ansible): Ubuntu Jammy VI.
Signed-off-by: Peter Mikus <pmikus@cisco.com>
Change-Id: I7dda690f2dc2e42bf6c67d3faa3327a03de3a9fa
Diffstat (limited to 'fdio.infra.ansible/roles/performance_tuning')
-rw-r--r-- | fdio.infra.ansible/roles/performance_tuning/handlers/main.yaml | 4 | ||||
-rw-r--r-- | fdio.infra.ansible/roles/performance_tuning/tasks/main.yaml | 39 |
2 files changed, 18 insertions, 25 deletions
diff --git a/fdio.infra.ansible/roles/performance_tuning/handlers/main.yaml b/fdio.infra.ansible/roles/performance_tuning/handlers/main.yaml index fa2876b7ac..d2f8f5cb95 100644 --- a/fdio.infra.ansible/roles/performance_tuning/handlers/main.yaml +++ b/fdio.infra.ansible/roles/performance_tuning/handlers/main.yaml @@ -2,12 +2,12 @@ # file roles/performance_tuning/handlers/main.yaml - name: Update GRUB - command: update-grub + ansible.builtin.command: update-grub tags: - update-grub - name: Reboot server - reboot: + ansible.builtin.reboot: reboot_timeout: 3600 tags: - reboot-server diff --git a/fdio.infra.ansible/roles/performance_tuning/tasks/main.yaml b/fdio.infra.ansible/roles/performance_tuning/tasks/main.yaml index e3e22d03ac..256cd27eaf 100644 --- a/fdio.infra.ansible/roles/performance_tuning/tasks/main.yaml +++ b/fdio.infra.ansible/roles/performance_tuning/tasks/main.yaml @@ -2,7 +2,7 @@ # file: roles/performance_tuning/tasks/main.yaml - name: Inst - Update Package Cache (APT) - apt: + ansible.builtin.apt: update_cache: true cache_valid_time: 3600 when: @@ -11,7 +11,7 @@ - perf-inst-prerequisites - name: Inst - Machine Prerequisites - package: + ansible.builtin.package: name: "{{ packages | flatten(levels=1) }}" state: latest tags: @@ -36,7 +36,7 @@ # programs, particularly malloc debuggers, may consume lots of them, # e.g., up to one or two maps per allocation. # must be greater than or equal to (2 * vm.nr_hugepages). - sysctl: + ansible.builtin.sysctl: name: "vm.max_map_count" value: "{{ sysctl.vm.nr_hugepages * 4 }}" state: "present" @@ -48,7 +48,7 @@ - name: Conf - Adjust hugetlb_shm_group # hugetlb_shm_group contains group id that is allowed to create sysv # shared memory segment using hugetlb page. - sysctl: + ansible.builtin.sysctl: name: "vm.hugetlb_shm_group" value: "1000" state: "present" @@ -63,7 +63,7 @@ # decrease the amount of swap. a value of 0 instructs the kernel not to # initiate swap until the amount of free and file-backed pages is less # than the high water mark in a zone. - sysctl: + ansible.builtin.sysctl: name: "vm.swappiness" value: "0" state: "present" @@ -78,7 +78,7 @@ # if the existing kernel.shmmax setting (cat /sys/proc/kernel/shmmax) # is greater than the calculated totalhugepagesize then set this parameter # to current shmmax value. - sysctl: + ansible.builtin.sysctl: name: "kernel.shmmax" value: "{{ sysctl.vm.nr_hugepages * 2 * 1024 * 1024 }}" state: "present" @@ -98,7 +98,7 @@ # typically this value would only be touched in the nohz_full case # to re-enable cores that by default were not running the watchdog, # if a kernel lockup was suspected on those cores. - sysctl: + ansible.builtin.sysctl: name: "kernel.watchdog_cpumask" value: "{{ sysctl.kernel.watchdog_cpumask }}" state: "present" @@ -114,7 +114,7 @@ # 0 - turn the process address space randomization off. this is the # default for architectures that do not support this feature anyways, # and kernels that are booted with the "norandmaps" parameter. - sysctl: + ansible.builtin.sysctl: name: "kernel.randomize_va_space" value: "0" state: "present" @@ -124,7 +124,7 @@ - perf-conf-sysctl - name: Conf - Cpufrequtils - copy: + ansible.builtin.copy: src: "files/cpufrequtils" dest: "/etc/default/cpufrequtils" owner: "root" @@ -134,7 +134,7 @@ - perf-conf-cpufrequtils - name: Conf - Irqbalance - template: + ansible.builtin.template: src: "files/irqbalance" dest: "/etc/default/irqbalance" owner: "root" @@ -143,15 +143,8 @@ tags: - perf-conf-irqbalance -- name: Conf - Set Ondemand Service To Disable - service: - name: "ondemand" - enabled: "no" - tags: - - perf-conf-ondemand - - name: Conf - Kernel Parameters - lineinfile: + ansible.builtin.lineinfile: path: "/etc/default/grub" state: "present" regexp: "^GRUB_CMDLINE_LINUX=" @@ -164,7 +157,7 @@ - meta: flush_handlers - name: Conf - Load Kernel Modules By Default - lineinfile: + ansible.builtin.lineinfile: path: "/etc/modules" state: "present" line: "{{ item }}" @@ -176,7 +169,7 @@ - perf-conf-load-kernel-modules - name: Conf - Create a directory for 1G HugeTLBs hugepages - file: + ansible.builtin.file: path: "/dev/hugepages1G" state: "directory" mode: 0755 @@ -184,7 +177,7 @@ - perf-conf-hugepages-1g - name: Conf - Mount 1G HugeTLBs hugepages - mount: + ansible.builtin.mount: path: "/dev/hugepages1G" src: "hugetlbfs" opts: "pagesize=1G" @@ -195,7 +188,7 @@ - perf-conf-hugepages-1g - name: Create a directory if it does not exist - file: + ansible.builtin.file: path: "/dev/hugepages2M" state: "directory" mode: 0755 @@ -203,7 +196,7 @@ - perf-conf-hugepages-2m - name: Conf - Create a directory for 2M HugeTLBs hugepages - mount: + ansible.builtin.mount: path: "/dev/hugepages2M" src: "hugetlbfs" opts: "pagesize=2M" |