puppet: Remove custom `vm.dirty_ratio` and `vm.dirty_background_ratio`.

These values differed between the primary and secondary database
hosts, for unclear reasons.  The differences date back to their
introduction in 387f63deaa.  As the comment in the replica
confguration notes, settings of `vm.dirty_ratio = 10` and
`vm.dirty_background_ratio = 5` matched the kernel defaults for
"newer" kernels; however, kernel 2.6.30 bumped those to 20 and 10,
respectively[1], as a fix for underlying logic now being more correct.

Remove these overrides; they should at very least be consistent across
roles, and the previous values look to be an attempt to tune for a
very much older version of the Linux kernel, which was using an
different, buggier, algorithm under the hood.

[1] 1b5e62b42b
This commit is contained in:
Alex Vandiver 2020-06-12 13:38:20 -07:00 committed by Tim Abbott
parent f39816e768
commit 55bd31721d
6 changed files with 10 additions and 32 deletions

View File

@ -0,0 +1,3 @@
# Virtual memory settings
vm.swappiness = 0
vm.overcommit_memory = 2

View File

@ -1,9 +0,0 @@
# Virtual memory settings
vm.swappiness = 0
vm.overcommit_memory = 2
# We don't want these numbers to be too large or else performance
# will be too spiky. These seem to give a good balance between low
# numbers and sequential write performance
vm.dirty_ratio = 5
vm.dirty_background_ratio = 2

View File

@ -1,7 +0,0 @@
# Virtual memory settings
vm.swappiness = 0
vm.overcommit_memory = 2
# These are the defaults on newer kernels
vm.dirty_ratio = 10
vm.dirty_background_ratio = 5

View File

@ -33,6 +33,13 @@ class zulip_ops::postgres_common {
]
}
file { '/etc/sysctl.d/40-postgresql.conf':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
source => 'puppet:///modules/zulip_ops/postgresql/40-postgresql.conf',
}
exec { 'sysctl_p':
command => '/sbin/sysctl -p /etc/sysctl.d/40-postgresql.conf',
subscribe => File['/etc/sysctl.d/40-postgresql.conf'],

View File

@ -1,12 +1,4 @@
class zulip_ops::postgres_master {
include zulip_ops::base
include zulip_ops::postgres_appdb
file { '/etc/sysctl.d/40-postgresql.conf':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
source => 'puppet:///modules/zulip_ops/postgresql/40-postgresql.conf.master',
}
}

View File

@ -1,12 +1,4 @@
class zulip_ops::postgres_slave {
include zulip_ops::base
include zulip_ops::postgres_appdb
file { '/etc/sysctl.d/40-postgresql.conf':
ensure => file,
owner => 'root',
group => 'root',
mode => '0644',
source => 'puppet:///modules/zulip_ops/postgresql/40-postgresql.conf.slave',
}
}