Use jemalloc on Zuul v3 executors

FreeBSD libc's malloc implementation, jemalloc, performs better than
glibc's for some tasks. In the case of our Zuul executors, we've
seen useful improvements in memory efficiency. Update the Puppet
module to install the libjemalloc1 package on Zuul executor servers
and export the necessary LD_PRELOAD envvar to use it when launching
executor daemons.

Change-Id: I8d8de3c118bd09d408b23a16482f71198a1232fc
This commit is contained in:
Jeremy Stanley 2019-02-19 23:09:18 +00:00
parent ebdb5fa51a
commit 7fdd302fd7
2 changed files with 8 additions and 1 deletions

View File

@ -33,6 +33,13 @@ class zuul::executor (
],
}
# Alternative malloc implementation with better packing performance
if ! defined(Package['libjemalloc1']) {
package { 'libjemalloc1':
ensure => present,
}
}
include ::pip::python3
exec { 'install-ara-safely':

View File

@ -503,7 +503,7 @@ class zuul (
file { '/etc/default/zuul-executor':
ensure => present,
mode => '0444',
content => "PIDFILE=/var/run/zuul/executor.pid\n",
content => "PIDFILE=/var/run/zuul/executor.pid\nexport LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libjemalloc.so.1\n",
}
file { '/etc/default/zuul-scheduler':