From 7ab4fdf250654780e6232e7e8379fe6b8c881303 Mon Sep 17 00:00:00 2001 From: Alex Vandiver Date: Thu, 9 Feb 2023 19:24:10 +0000 Subject: [PATCH] memcached: Allow overriding the max-item-size. This is necessary for organizations with extremely large numbers of members (20k+). --- docs/production/deployment.md | 6 ++++++ puppet/zulip/manifests/profile/memcached.pp | 1 + puppet/zulip/templates/memcached.conf.template.erb | 4 ++++ 3 files changed, 11 insertions(+) diff --git a/docs/production/deployment.md b/docs/production/deployment.md index 5dd910f6ad..4294cecb1b 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 52785c2753..1008dff962 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 ba8f8acc78..bd8c5dff9c 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 -%>