Andrew Bogott has submitted this change and it was merged.

Change subject: labs: restart slapd if it uses > 50% of memory
......................................................................


labs: restart slapd if it uses > 50% of memory

Add a cron that restarts slapd <s>once a week</s> to mitigate the slapd memory
leak issue, as suggested by Moritz.

Amended to restart it if it really uses more than 50% of the memory, check in an
hourly cron. As suggested by _joe_ in comments.

Copied from mediawiki::jobrunner where we do the same for hhvm.

Bug: T130593
Change-Id: Idf33099b07d3d231a0c229628db5c9d6c67dd8b0
---
M modules/role/manifests/openldap/labs.pp
1 file changed, 7 insertions(+), 0 deletions(-)

Approvals:
  Andrew Bogott: Looks good to me, but someone else must approve
  ArielGlenn: Looks good to me, but someone else must approve
  jenkins-bot: Verified
  Dzahn: Looks good to me, approved



diff --git a/modules/role/manifests/openldap/labs.pp 
b/modules/role/manifests/openldap/labs.pp
index 7674219..8793286 100644
--- a/modules/role/manifests/openldap/labs.pp
+++ b/modules/role/manifests/openldap/labs.pp
@@ -45,6 +45,13 @@
         critical      => false,
     }
 
+    # restart slapd if it uses more than 50% of memory (T130593)
+    cron { 'restart_slapd':
+        ensure  => present,
+        minute  => fqdn_rand(59, $title),
+        command => '/bin/ps -C slapd -o pmem= | awk \'{sum+=$1} END { if (sum 
<= 50.0) exit 1  }\' && /bin/systemctl restart slapd >/dev/null 2>/dev/null',
+    }
+
     $monitor_pass = $passwords::openldap::labs::monitor_pass
     diamond::collector { 'OpenLDAP':
         settings => {

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Idf33099b07d3d231a0c229628db5c9d6c67dd8b0
Gerrit-PatchSet: 9
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Dzahn <[email protected]>
Gerrit-Reviewer: Alexandros Kosiaris <[email protected]>
Gerrit-Reviewer: Andrew Bogott <[email protected]>
Gerrit-Reviewer: ArielGlenn <[email protected]>
Gerrit-Reviewer: Chasemp <[email protected]>
Gerrit-Reviewer: Dzahn <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Muehlenhoff <[email protected]>
Gerrit-Reviewer: Rush <[email protected]>
Gerrit-Reviewer: Yuvipanda <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

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

Reply via email to