Filippo Giunchedi has submitted this change and it was merged.

Change subject: Configurable `vm.dirty_background_bytes` parameter
......................................................................


Configurable `vm.dirty_background_bytes` parameter

Creates a Cassandra-specific mechanism for assigning a value to
`vm.dirty_background_bytes`, and sets the parameter to 24MB on the RESTBase
Cassandra clusters.

Since this is essentially a host-wide way of accomplishing what `trickle_fsync`
does, this changeset also disables `trickle_fsync` for the RESTBase Cassandra
clusters.

Bug: T140825
Change-Id: I1c47ac91e6e3c3edf99a5b65228804c8836f11c3
---
M hieradata/role/common/cassandra.yaml
M manifests/role/cassandra.pp
A modules/cassandra/manifests/sysctl.pp
3 files changed, 35 insertions(+), 0 deletions(-)

Approvals:
  Filippo Giunchedi: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/hieradata/role/common/cassandra.yaml 
b/hieradata/role/common/cassandra.yaml
index 7b25ae0..58fca50 100644
--- a/hieradata/role/common/cassandra.yaml
+++ b/hieradata/role/common/cassandra.yaml
@@ -129,3 +129,4 @@
 cassandra::application_password: "%{passwords::cassandra::restbase}"
 cassandra::target_version: '2.2'
 cassandra::permissions_validity_in_ms: 600000
+cassandra::trickle_fsync: 'false'
diff --git a/manifests/role/cassandra.pp b/manifests/role/cassandra.pp
index 94d811c..d361df1 100644
--- a/manifests/role/cassandra.pp
+++ b/manifests/role/cassandra.pp
@@ -9,6 +9,11 @@
     class { '::cassandra::metrics': }
     class { '::cassandra::logging': }
 
+    class { '::cassandra::sysctl':
+        # Queue page flushes at 24MB intervals
+        vm_dirty_background_bytes => 25165824,
+    }
+
     $cassandra_instances = $::cassandra::instances
 
     if $cassandra_instances {
diff --git a/modules/cassandra/manifests/sysctl.pp 
b/modules/cassandra/manifests/sysctl.pp
new file mode 100644
index 0000000..2d14b80
--- /dev/null
+++ b/modules/cassandra/manifests/sysctl.pp
@@ -0,0 +1,29 @@
+# == Class: cassandra::sysctl
+#
+# Configure sysctl parameters for Cassandra
+#
+# === Usage
+# class { '::cassandra::sysctl':
+#     vm_dirty_background_bytes => <num>,
+# }
+#
+# === Parameters
+# [*vm_dirty_background_bytes*]
+#   The `vm.dirty_background_bytes' kernel parameter
+#   Default: 0
+
+class cassandra::sysctl(
+    $vm_dirty_background_bytes = 0,
+){
+    if (!is_integer($vm_dirty_background_bytes)) {
+        fail('vm_dirty_background_bytes must be a number')
+    }
+
+    # 05-cassandra.conf
+    sysctl::parameters { 'cassandra':
+        values   => {
+            'vm.dirty_background_bytes' => $vm_dirty_background_bytes,
+        },
+        priority => 5,
+    }
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/301425
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I1c47ac91e6e3c3edf99a5b65228804c8836f11c3
Gerrit-PatchSet: 9
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Eevans <eev...@wikimedia.org>
Gerrit-Reviewer: Alexandros Kosiaris <akosia...@wikimedia.org>
Gerrit-Reviewer: Dzahn <dz...@wikimedia.org>
Gerrit-Reviewer: Eevans <eev...@wikimedia.org>
Gerrit-Reviewer: Elukey <ltosc...@wikimedia.org>
Gerrit-Reviewer: Filippo Giunchedi <fgiunch...@wikimedia.org>
Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to