Skip to content

Commit

Permalink
Merge pull request #126 from jt-edb/merge_3_0_0_master_2
Browse files Browse the repository at this point in the history
Autotuning: configure vm.overcommit_ratio
  • Loading branch information
jt-edb authored Jan 21, 2021
2 parents f345bfc + 1b5d75b commit d5a2b4e
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.0.2
3.0.3
21 changes: 21 additions & 0 deletions roles/autotuning/tasks/setup_tuned.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,25 @@
---
# With vm.swapiness=1 and vm.overcommit_memory=2, vm.overcommit_ratio should
# allow the system to use the entire memory available.
#
# RAM * vm.overcommit_ratio
# Max Alloc = SWAP + -------------------------
# 100
#
# If we want to allow the system to allocate the entire memory (Max Alloc =
# RAM), then, overcommit_ratio is calculated as below:
#
# RAM - SWAP
# vm.overcommit_ratio = ------------ * 100
# RAM
#
# We ensure a minimum value of 50. This is usefull for the case when the amount
# of swap memory is ridiculous higher than the RAM size
- name: Set vm_overcommit_ratio
set_fact:
vm_overcommit_ratio: >-
{{ [ ((ansible_memtotal_mb - ansible_swaptotal_mb) / ansible_memtotal_mb * 100) | int,
50 ] | max }}
- name: Set the variable tuned_disk_elevator for CentOS/RHEL 7
set_fact:
Expand Down
1 change: 1 addition & 0 deletions roles/autotuning/templates/tuned.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ elevator={{ tuned_disk_elevator }}
[sysctl]
{% if 'pemserver' not in group_names %}
vm.overcommit_memory=2
vm.overcommit_ratio={{ vm_overcommit_ratio }}
vm.swappiness=1
{% endif %}
vm.dirty_ratio=30
Expand Down

0 comments on commit d5a2b4e

Please sign in to comment.