Add sysctl states for vm, fs and some kernel params.

This commit is contained in:
Antsiferov Grigory 2017-09-19 09:56:31 +03:00
parent 75af253151
commit f0d8ab72da
3 changed files with 49 additions and 0 deletions

11
sls/sysctl/fs.sls Normal file
View File

@ -0,0 +1,11 @@
{% set fs = salt['pillar.get']('sysctl:fs', {}) %}
fs.file-max:
sysctl.present:
- config: '/etc/sysctl.d/fs.conf'
- value: {{ fs.get('file-max', 1000000) }}
fs.inotify.max_user_watches:
sysctl.present:
- config: '/etc/sysctl.d/fs.conf'
- value: {{ fs.get('inotify.max_user_watches', 100000) }}

11
sls/sysctl/kernel.sls Normal file
View File

@ -0,0 +1,11 @@
kernel.pid_max:
sysctl.present:
- value: 999999
kernel.panic:
sysctl.present:
- value : 30
kernel.sched_migration_cost_ns:
sysctl.present:
- value: 5000000

27
sls/sysctl/vm.sls Normal file
View File

@ -0,0 +1,27 @@
{% set vm = salt['pillar.get']('sysctl:vm', {}) %}
vm.swappiness:
sysctl.present:
- config: '/etc/sysctl.d/vm.conf'
- value: {{ vm.get('swappiness', 0) }}
vm.zone_reclaim_mode:
sysctl.present:
- config: '/etc/sysctl.d/vm.conf'
- value: {{ vm.get('zone_reclaim_mode', 0) }}
vm.dirty_bytes:
sysctl.present:
- config: '/etc/sysctl.d/vm.conf'
- value: {{ vm.get('dirty_bytes', 33554432) }}
vm.dirty_background_bytes:
sysctl.present:
- config: '/etc/sysctl.d/vm.conf'
- value: {{ vm.get('dirty_background_bytes', 8388608) }}
vm.min_free_kbytes:
sysctl.present:
- config: '/etc/sysctl.d/vm.conf'
- value: {{ vm.get('min_free_kbytes', 262144) }}