mirror of https://github.com/zulip/zulip.git
puppet: Automatically scale default memcached memory allocation.
Previously, we used a fixed memcached memory allocation of 512MB, regardless of the size of the server. While that is a good allocation for a server with 4GB of RAM, for servers with less, we should decrease the allocation, and for a large server with much more RAM, we should increase it. We still support the user overriding the configuration setting, but this produces more sensible defaults.
This commit is contained in:
parent
2e0e8193d4
commit
2581ac166c
|
@ -2,7 +2,8 @@ class zulip::memcached {
|
|||
$memcached_packages = ["memcached"]
|
||||
package { $memcached_packages: ensure => "installed" }
|
||||
|
||||
$memcached_memory = zulipconf("memcached", "memory", "512")
|
||||
$total_memory_mb = regsubst(file('/proc/meminfo'), '^.*MemTotal:\s*(\d+) kB.*$', '\1', 'M') / 1024
|
||||
$memcached_memory = zulipconf("memcached", "memory", $total_memory_mb / 8)
|
||||
file { "/etc/memcached.conf":
|
||||
require => Package[memcached],
|
||||
ensure => file,
|
||||
|
|
Loading…
Reference in New Issue