Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

memcached: Allow overriding the max-item-size.

Alex Vandiver7ab4fdf25065
diff --git a/docs/production/deployment.md b/docs/production/deployment.md
index 5dd910f6ad6..4294cecb1bb 100644
--- a/docs/production/deployment.md
+++ b/docs/production/deployment.md
@@ -800,6 +800,12 @@ The version of PostgreSQL that is in use. Do not set by hand; use the
Override the number of megabytes of memory that memcached should be
configured to consume; defaults to 1/8th of the total server memory.
+#### `max_item_size`
+
+Override the maximum size that an item in memcached can store. This defaults to
+1m; adjusting it should only be necessary if your Zulip server has organizations
+which have more than 20k users.
+
### `[loadbalancer]`
#### `ips`
diff --git a/puppet/zulip/manifests/profile/memcached.pp b/puppet/zulip/manifests/profile/memcached.pp
index 52785c27538..1008dff9625 100644
--- a/puppet/zulip/manifests/profile/memcached.pp
+++ b/puppet/zulip/manifests/profile/memcached.pp
@@ -18,6 +18,7 @@ class zulip::profile::memcached {
}
package { $memcached_packages: ensure => installed }
+ $memcached_max_item_size = zulipconf('memcached', 'max_item_size', '1m')
$memcached_memory = zulipconf('memcached', 'memory', $zulip::common::total_memory_mb / 8)
file { '/etc/sasl2':
ensure => directory,
diff --git a/puppet/zulip/templates/memcached.conf.template.erb b/puppet/zulip/templates/memcached.conf.template.erb
index ba8f8acc78d..bd8c5dff9ce 100644
--- a/puppet/zulip/templates/memcached.conf.template.erb
+++ b/puppet/zulip/templates/memcached.conf.template.erb
@@ -51,3 +51,7 @@ logfile /var/log/memcached.log
# Enable SASL authentication
-S
+<% if @memcached_max_item_size != '1m' %>
+# Larger max-item-size
+-I <%= @memcached_max_item_size %>
+<% end -%>