BBlack has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/362439 )

Change subject: NUMA binding for cache frontends under 'isolate'
......................................................................


NUMA binding for cache frontends under 'isolate'

Binding the cache frontends to the network node won't make sense
on many of our legacy hardware configs due to limitations.  It
will make sense only on our latest config and possibly the other
most-recent one as well (the 256GB symmetric nodes).  On the older
machines that shouldn't bind varnish-frontend, it's also too
wasteful to isolate the node just for nginx and nothing else.
Therefore, tie the binding of varnish to the 'isolate' setting.

Change-Id: Ie67991ab785714e4c0e27f14b5081b8148e3fba6
---
M modules/role/manifests/cache/instances.pp
M modules/varnish/manifests/instance.pp
M modules/varnish/templates/initscripts/varnish.systemd.erb
3 files changed, 11 insertions(+), 2 deletions(-)

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



diff --git a/modules/role/manifests/cache/instances.pp 
b/modules/role/manifests/cache/instances.pp
index 99daba4..7efb1eb 100644
--- a/modules/role/manifests/cache/instances.pp
+++ b/modules/role/manifests/cache/instances.pp
@@ -103,6 +103,13 @@
     # Set a reduced keep value for frontends
     $fe_keep_vcl_config = merge($fe_vcl_config, { 'keep' => '1d', })
 
+    if $::numa_networking == 'isolate' {
+        $nnodes = 
join($facts['numa']['device_to_node'][$facts['interface_primary']],',')
+        $fe_cmd_prefix = "/usr/bin/numactl -a -N ${nnodes} -m ${nnodes}"
+    } else {
+        $fe_cmd_prefix = ''
+    }
+
     # lint:ignore:arrow_alignment
     varnish::instance { "${title}-frontend":
         instance_name      => 'frontend',
@@ -123,6 +130,7 @@
             },
         },
         vcl_config         => $fe_keep_vcl_config,
+        start_cmd_prefix   => $fe_cmd_prefix,
     }
     # lint:endignore
 }
diff --git a/modules/varnish/manifests/instance.pp 
b/modules/varnish/manifests/instance.pp
index c9ff2a7..2d83ed3 100644
--- a/modules/varnish/manifests/instance.pp
+++ b/modules/varnish/manifests/instance.pp
@@ -11,7 +11,8 @@
     $app_directors={},
     $app_def_be_opts={},
     $backend_caches={},
-    $extra_vcl = []
+    $extra_vcl = [],
+    $start_cmd_prefix = '',
 ) {
 
     include ::varnish::common
diff --git a/modules/varnish/templates/initscripts/varnish.systemd.erb 
b/modules/varnish/templates/initscripts/varnish.systemd.erb
index 5b3d4c3..6a67cb3 100644
--- a/modules/varnish/templates/initscripts/varnish.systemd.erb
+++ b/modules/varnish/templates/initscripts/varnish.systemd.erb
@@ -16,7 +16,7 @@
 Environment="MALLOC_CONF=<%= @jemalloc_conf %>"
 <% end -%>
 ExecReload=/usr/share/varnish/reload-vcl <%= @extraopts %> -q
-ExecStart=/usr/sbin/varnishd \
+ExecStart=<%= @start_cmd_prefix %>/usr/sbin/varnishd \
 -P %t/%p.pid \
 <%= @ports.map { |p| "-a :"+p }.join(" ") -%> \
 -T 127.0.0.1:<%= @admin_port -%> \

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ie67991ab785714e4c0e27f14b5081b8148e3fba6
Gerrit-PatchSet: 5
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: BBlack <[email protected]>
Gerrit-Reviewer: BBlack <[email protected]>
Gerrit-Reviewer: Ema <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to