aboutsummaryrefslogtreecommitdiffstats
path: root/roles/_workstation/kernel/tasks/main.yml
blob: f711428a17090d7ab83917868dbb6bc0b6159fb9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
---

- name: create sysctl configuration file
  ansible.builtin.file:
    path: "{{ kernel_sysctl_configuration_file }}"
    owner: 0
    group: 0
    mode: "0644"

- name: apply memory optimizations
  ansible.builtin.blockinfile:
    path: "{{ kernel_sysctl_configuration_file }}"
    block: |
      kern.shminfo.shmall=3145728
      kern.shminfo.shmmax=1073741823
      kern.shminfo.shmmni=1024
      kern.shminfo.shmseg=1024
      kern.seminfo.semmns=4096
      kern.seminfo.semmni=1024
    marker_begin: "memory - BEGIN"
    marker_end: "memory - END"

- name: apply process optimizations
  ansible.builtin.blockinfile:
    path: "{{ kernel_sysctl_configuration_file }}"
    block: |
      kern.maxfiles=102400
      kern.maxproc=32768
      kern.maxfiles=65535
      kern.bufcachepercent=90
      kern.maxvnodes=262144
      kern.somaxconn=2048
    marker_begin: "process - BEGIN"
    marker_end: "process - END"
remember that computers suck.