Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 43438bf

Browse files
authoredApr 25, 2021
Add plumbing for new queue_workers_multiprocess setting.
1 parent 9b7c0db commit 43438bf

File tree

2 files changed

+22
-0
lines changed

2 files changed

+22
-0
lines changed
 

‎README.md

+7
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,13 @@ which you need to encode in the YAML file. For example,
191191
comma-separated list of the backend names
192192
(E.g. `"EmailAuthBackend,GitHubAuthBackend"`).
193193

194+
**Reducing RAM usage**. By default, the Zulip server automatically detect
195+
whether the system has enough memory to run Zulip queue processors in the
196+
higher-throughput but more multiprocess mode (or to save 1.5GiB of RAM with
197+
the multithreaded mode). This algorithm might see the host's memory, not the
198+
docker container's memory. Set to `QUEUE_WORKERS_MULTIPROCESS` to `true` or
199+
`false` to override the automatic calculation.
200+
194201
**SSL Certificates**. By default, the image will generate a self-signed cert.
195202
You can set `SSL_CERTIFICATE_GENERATION: "certbot"` within `docker-compose.yml`
196203
to enable automatically-renewed Let's Encrypt certificates. By using certbot

‎entrypoint.sh

+15
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,20 @@ nginxConfiguration() {
131131
sed -i "s/proxy_buffering .*/proxy_buffering $NGINX_PROXY_BUFFERING;/g" /etc/nginx/zulip-include/proxy_longpolling
132132
echo "Nginx configuration succeeded."
133133
}
134+
additionalPuppetConfiguration() {
135+
echo "Executing additional puppet configuration ..."
136+
if [ "$QUEUE_WORKERS_MULTIPROCESS" == "True" ] || [ "$QUEUE_WORKERS_MULTIPROCESS" == "true" ]; then
137+
echo "Setting queue workers to run in multiprocess mode ..."
138+
crudini --set /etc/zulip/zulip.conf application_server queue_workers_multiprocess true
139+
elif [ "$QUEUE_WORKERS_MULTIPROCESS" == "False" ] || [ "$QUEUE_WORKERS_MULTIPROCESS" == "false" ]; then
140+
echo "Setting queue workers to run in multithreaded mode ..."
141+
crudini --set /etc/zulip/zulip.conf application_server queue_workers_multiprocess false
142+
else
143+
echo "No additional puppet configuration executed."
144+
return 0
145+
fi
146+
/home/zulip/deployments/current/scripts/zulip-puppet-apply -f
147+
}
134148
configureCerts() {
135149
case "$SSL_CERTIFICATE_GENERATION" in
136150
self-signed)
@@ -294,6 +308,7 @@ initialConfiguration() {
294308
prepareDirectories
295309
nginxConfiguration
296310
configureCerts
311+
additionalPuppetConfiguration
297312
if [ "$MANUAL_CONFIGURATION" = "False" ] || [ "$MANUAL_CONFIGURATION" = "false" ]; then
298313
# Start with the settings template file.
299314
cp -a /home/zulip/deployments/current/zproject/prod_settings_template.py "$SETTINGS_PY"

0 commit comments

Comments
 (0)
Please sign in to comment.