Elukey has submitted this change and it was merged.

Change subject: Refactor memcached role to allow a more flexible hieradata 
config
......................................................................


Refactor memcached role to allow a more flexible hieradata config

There are currently multiple versions of the memcached package
installed across eqiad and codfw, mostly due to performance experiments.
The long term view is to have a single version installed everywhere,
but in the meantime we need a bit more flexibility.

Bug: T129963
Change-Id: I34be02040a888058d64c3de3f12ee61606daf396
---
M hieradata/hosts/mc1009.yaml
A hieradata/hosts/mc1010.yaml
A hieradata/hosts/mc2009.yaml
A hieradata/hosts/mc2010.yaml
M manifests/role/memcached.pp
5 files changed, 42 insertions(+), 39 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, but someone else must approve
  Elukey: Looks good to me, approved
  Giuseppe Lavagetto: Looks good to me, but someone else must approve
  jenkins-bot: Verified



diff --git a/hieradata/hosts/mc1009.yaml b/hieradata/hosts/mc1009.yaml
index 5fc1999..1ae36de 100644
--- a/hieradata/hosts/mc1009.yaml
+++ b/hieradata/hosts/mc1009.yaml
@@ -1,3 +1,13 @@
 debdeploy::grains:
   debdeploy-memcached:
     value: canary
+# The maximum number of slab classes is 64 from >= 1.4.25
+# so a different growth factor is needed to manage the same workload.
+# More info: T129963
+memcached::version: '1.4.25-2~wmf1'
+memcached::growth_factor: '1.15'
+memcached::extended_options:
+  - 'slab_reassign'
+  - 'slab_automove'
+  - 'lru_crawler'
+  - 'lru_maintainer'
\ No newline at end of file
diff --git a/hieradata/hosts/mc1010.yaml b/hieradata/hosts/mc1010.yaml
new file mode 100644
index 0000000..3dfd910
--- /dev/null
+++ b/hieradata/hosts/mc1010.yaml
@@ -0,0 +1,10 @@
+# The maximum number of slab classes is 64 from >= 1.4.25
+# so a different growth factor is needed to manage the same workload.
+# More info: T129963
+memcached::version: '1.4.25-2~wmf1'
+memcached::growth_factor: '1.15'
+memcached::extended_options:
+  - 'slab_reassign'
+  - 'slab_automove'
+  - 'lru_crawler'
+  - 'lru_maintainer'
\ No newline at end of file
diff --git a/hieradata/hosts/mc2009.yaml b/hieradata/hosts/mc2009.yaml
new file mode 100644
index 0000000..180e955
--- /dev/null
+++ b/hieradata/hosts/mc2009.yaml
@@ -0,0 +1,10 @@
+# The maximum number of slab classes is 64 from >= 1.4.25
+# so a different growth factor is needed to manage the same workload.
+# More info: T129963
+memcached::version: '1.4.28-1.1+wmf1'
+memcached::growth_factor: '1.15'
+memcached::extended_options:
+  - 'slab_reassign'
+  - 'slab_automove'
+  - 'lru_crawler'
+  - 'lru_maintainer'
\ No newline at end of file
diff --git a/hieradata/hosts/mc2010.yaml b/hieradata/hosts/mc2010.yaml
new file mode 100644
index 0000000..28c7b4b
--- /dev/null
+++ b/hieradata/hosts/mc2010.yaml
@@ -0,0 +1,5 @@
+memcached::extended_options:
+  - 'slab_reassign'
+  - 'lru_crawler'
+  - 'maxconns_fast'
+  - 'hash_algorithm=murmur3'
\ No newline at end of file
diff --git a/manifests/role/memcached.pp b/manifests/role/memcached.pp
index adbb6ce..a53a609 100644
--- a/manifests/role/memcached.pp
+++ b/manifests/role/memcached.pp
@@ -12,48 +12,16 @@
         'labs'       => 3000,
     }
 
-    # The following hosts will get different package versions
-    # deployed manually. This workaround should avoid
-    # disabling puppet for the whole duration of the test.
+    # There are different package versions available due to a performance test,
+    # most of them are deployed/installed manually.
     # More info: T129963
-    if $::hostname == 'mc2009' {
-        $version =  '1.4.28-1.1+wmf1'
-    } elsif $::hostname =~ /mc10(09|10)/ {
-        $version =  '1.4.25-2~wmf1'
-    } else {
-        $version = os_version('debian >= jessie || ubuntu >= trusty') ? {
-            true    => 'present',
-            default => '1.4.15-0wmf1',
-        }
+    $version = os_version('debian >= jessie || ubuntu >= trusty') ? {
+        true    => hiera('memcached::version', 'present'),
+        default => '1.4.15-0wmf1',
     }
 
-    # The following hosts are configured with newer memcached versions
-    # (1.4.25-2~wmf1 and 1.4.28-1.1+wmf1) as part of a performance experiment.
-    # The maximum number of slab classes is 64 from >= 1.4.25
-    # so a different growth factor is needed to manage the same workload.
-    # More info: T129963
-    if $::hostname == 'mc2009' or $::hostname =~ /mc10(09|10)/ {
-        $growth_factor    = 1.15
-        $extended_options = [
-            'slab_reassign',
-            'slab_automove',
-            'lru_crawler',
-            'lru_maintainer',
-        ]
-    } elsif $::hostname == 'mc2010' {
-        $growth_factor    = 1.05
-        $extended_options = [
-            'slab_reassign',
-            'lru_crawler',
-            'maxconns_fast',
-            'hash_algorithm=murmur3',
-        ]
-    } else {
-        $growth_factor    = 1.05
-        $extended_options = [
-            'slab_reassign'
-        ]
-    }
+    $growth_factor = hiera('memcached::growth_factor', 1.05)
+    $extended_options = hiera_array('memcached::extended_options', 
['slab_reassign'])
 
     class { '::memcached':
         size          => $memcached_size,

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I34be02040a888058d64c3de3f12ee61606daf396
Gerrit-PatchSet: 4
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Elukey <ltosc...@wikimedia.org>
Gerrit-Reviewer: Elukey <ltosc...@wikimedia.org>
Gerrit-Reviewer: Giuseppe Lavagetto <glavage...@wikimedia.org>
Gerrit-Reviewer: Ori.livneh <o...@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