diff --git a/puppet/zulip/manifests/app_frontend_base.pp b/puppet/zulip/manifests/app_frontend_base.pp index acdc949b5e..6a071a3aa4 100644 --- a/puppet/zulip/manifests/app_frontend_base.pp +++ b/puppet/zulip/manifests/app_frontend_base.pp @@ -58,6 +58,7 @@ class zulip::app_frontend_base { } } + $queues = $zulip::base::normal_queues file { "/etc/supervisor/conf.d/zulip.conf": require => Package[supervisor], ensure => file, diff --git a/puppet/zulip/manifests/base.pp b/puppet/zulip/manifests/base.pp index 45a70e76bb..5911252e3a 100644 --- a/puppet/zulip/manifests/base.pp +++ b/puppet/zulip/manifests/base.pp @@ -35,6 +35,22 @@ class zulip::base { 'xenial' => '9.5', } + $normal_queues = [ + 'digest_emails', + 'email_mirror', + 'embed_links', + 'error_reports', + 'feedback_messages', + 'invites', + 'missedmessage_emails', + 'missedmessage_mobile_notifications', + 'signups', + 'slow_queries', + 'user_activity', + 'user_activity_interval', + 'user_presence', + ] + group { 'zulip': ensure => present, } diff --git a/puppet/zulip/templates/supervisor/zulip.conf.template.erb b/puppet/zulip/templates/supervisor/zulip.conf.template.erb index aabbde63a8..1241a0651b 100644 --- a/puppet/zulip/templates/supervisor/zulip.conf.template.erb +++ b/puppet/zulip/templates/supervisor/zulip.conf.template.erb @@ -37,8 +37,9 @@ stdout_logfile_maxbytes=1GB ; max # logfile bytes b4 rotation (default 50MB) stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) directory=/home/zulip/deployments/current/ -[program:zulip-events-user-activity] -command=/home/zulip/deployments/current/manage.py process_queue --queue_name=user_activity +<% @queues.each do |queue| -%> +[program:zulip_events_<%= queue %>] +command=/home/zulip/deployments/current/manage.py process_queue --queue_name=<%= queue %> priority=300 ; the relative start priority (default 999) autostart=true ; start at supervisord start (default: true) autorestart=true ; whether/when to restart (default: unexpected) @@ -46,105 +47,22 @@ stopsignal=TERM ; signal used to kill process (default TERM) stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10) user=zulip ; setuid to this UNIX account to run the program redirect_stderr=true ; redirect proc stderr to stdout (default false) -stdout_logfile=/var/log/zulip/events-user-activity.log ; stdout log path, NONE for none; default AUTO +stdout_logfile=/var/log/zulip/events_<%= queue %>.log ; stdout log path, NONE for none; default AUTO stdout_logfile_maxbytes=1GB ; max # logfile bytes b4 rotation (default 50MB) stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) directory=/home/zulip/deployments/current/ +<% end -%> -[program:zulip-events-user-activity-interval] -command=/home/zulip/deployments/current/manage.py process_queue --queue_name=user_activity_interval -priority=300 ; the relative start priority (default 999) -autostart=true ; start at supervisord start (default: true) -autorestart=true ; whether/when to restart (default: unexpected) -stopsignal=TERM ; signal used to kill process (default TERM) -stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10) -user=zulip ; setuid to this UNIX account to run the program -redirect_stderr=true ; redirect proc stderr to stdout (default false) -stdout_logfile=/var/log/zulip/events-user-activity-interval.log ; stdout log path, NONE for none; default AUTO -stdout_logfile_maxbytes=1GB ; max # logfile bytes b4 rotation (default 50MB) -stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) -directory=/home/zulip/deployments/current/ - -[program:zulip-events-user-presence] -command=/home/zulip/deployments/current/manage.py process_queue --queue_name=user_presence -priority=300 ; the relative start priority (default 999) -autostart=true ; start at supervisord start (default: true) -autorestart=true ; whether/when to restart (default: unexpected) -stopsignal=TERM ; signal used to kill process (default TERM) -stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10) -user=zulip ; setuid to this UNIX account to run the program -redirect_stderr=true ; redirect proc stderr to stdout (default false) -stdout_logfile=/var/log/zulip/events-user-presence.log ; stdout log path, NONE for none; default AUTO -stdout_logfile_maxbytes=1GB ; max # logfile bytes b4 rotation (default 50MB) -stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) -directory=/home/zulip/deployments/current/ - -[program:zulip-events-signups] -command=/home/zulip/deployments/current/manage.py process_queue --queue_name=signups -priority=400 ; the relative start priority (default 999) +[program:zulip-deliver-enqueued-emails] +command=/home/zulip/deployments/current/manage.py deliver_email +priority=350 ; the relative start priority (default 999) autostart=true ; start at supervisord start (default: true) autorestart=true ; whether/when to restart (default: unexpected) stopsignal=TERM ; signal used to kill process (default TERM) -stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10) +topwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10) user=zulip ; setuid to this UNIX account to run the program redirect_stderr=true ; redirect proc stderr to stdout (default false) -stdout_logfile=/var/log/zulip/events-signups.log ; stdout log path, NONE for none; default AUTO -stdout_logfile_maxbytes=1GB ; max # logfile bytes b4 rotation (default 50MB) -stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) -directory=/home/zulip/deployments/current/ - -[program:zulip-events-confirmation-emails] -command=/home/zulip/deployments/current/manage.py process_queue --queue_name=invites -priority=500 ; the relative start priority (default 999) -autostart=true ; start at supervisord start (default: true) -autorestart=true ; whether/when to restart (default: unexpected) -stopsignal=TERM ; signal used to kill process (default TERM) -stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10) -user=zulip ; setuid to this UNIX account to run the program -redirect_stderr=true ; redirect proc stderr to stdout (default false) -stdout_logfile=/var/log/zulip/events-confirmation-emails.log ; stdout log path, NONE for none; default AUTO -stdout_logfile_maxbytes=1GB ; max # logfile bytes b4 rotation (default 50MB) -stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) -directory=/home/zulip/deployments/current/ - -[program:zulip-events-missedmessage_reminders] -command=/home/zulip/deployments/current/manage.py process_queue --queue_name=missedmessage_emails -priority=600 ; the relative start priority (default 999) -autostart=true ; start at supervisord start (default: true) -autorestart=true ; whether/when to restart (default: unexpected) -stopsignal=TERM ; signal used to kill process (default TERM) -stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10) -user=zulip ; setuid to this UNIX account to run the program -redirect_stderr=true ; redirect proc stderr to stdout (default false) -stdout_logfile=/var/log/zulip/events-missedmessage_reminders.log ; stdout log path, NONE for none; default AUTO -stdout_logfile_maxbytes=1GB ; max # logfile bytes b4 rotation (default 50MB) -stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) -directory=/home/zulip/deployments/current/ - -[program:zulip-events-missedmessage_mobile_notifications] -command=/home/zulip/deployments/current/manage.py process_queue --queue_name=missedmessage_mobile_notifications -priority=600 ; the relative start priority (default 999) -autostart=true ; start at supervisord start (default: true) -autorestart=true ; whether/when to restart (default: unexpected) -stopsignal=TERM ; signal used to kill process (default TERM) -stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10) -user=zulip ; setuid to this UNIX account to run the program -redirect_stderr=true ; redirect proc stderr to stdout (default false) -stdout_logfile=/var/log/zulip/events-missedmessage_mobile_notifications.log ; stdout log path, NONE for none; default AUTO -stdout_logfile_maxbytes=1GB ; max # logfile bytes b4 rotation (default 50MB) -stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) -directory=/home/zulip/deployments/current/ - -[program:zulip-events-slowqueries] -command=/home/zulip/deployments/current/manage.py process_queue --queue_name=slow_queries -priority=600 ; the relative start priority (default 999) -autostart=true ; start at supervisord start (default: true) -autorestart=true ; whether/when to restart (default: unexpected) -stopsignal=TERM ; signal used to kill process (default TERM) -stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10) -user=zulip ; setuid to this UNIX account to run the program -redirect_stderr=true ; redirect proc stderr to stdout (default false) -stdout_logfile=/var/log/zulip/events-slow_queries.log ; stdout log path, NONE for none; default AUTO +-stdout_logfile=/var/log/zulip/events-deliver_enqueued_emails.log ; stdout log path, NONE for none; default AUTO stdout_logfile_maxbytes=1GB ; max # logfile bytes b4 rotation (default 50MB) stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) directory=/home/zulip/deployments/current/ @@ -165,98 +83,13 @@ stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) directory=/home/zulip/deployments/current/ numprocs=5 -[program:zulip-events-feedback_messages] -command=/home/zulip/deployments/current/manage.py process_queue --queue_name=feedback_messages -priority=600 ; the relative start priority (default 999) -autostart=true ; start at supervisord start (default: true) -autorestart=true ; whether/when to restart (default: unexpected) -stopsignal=TERM ; signal used to kill process (default TERM) -stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10) -user=zulip ; setuid to this UNIX account to run the program -redirect_stderr=true ; redirect proc stderr to stdout (default false) -stdout_logfile=/var/log/zulip/events-feedback_messages.log ; stdout log path, NONE for none; default AUTO -stdout_logfile_maxbytes=1GB ; max # logfile bytes b4 rotation (default 50MB) -stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) -directory=/home/zulip/deployments/current/ - -[program:zulip-events-error_reports] -command=/home/zulip/deployments/current/manage.py process_queue --queue_name=error_reports -priority=600 ; the relative start priority (default 999) -autostart=true ; start at supervisord start (default: true) -autorestart=true ; whether/when to restart (default: unexpected) -stopsignal=TERM ; signal used to kill process (default TERM) -stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10) -user=zulip ; setuid to this UNIX account to run the program -redirect_stderr=true ; redirect proc stderr to stdout (default false) -stdout_logfile=/var/log/zulip/events-error_reports.log ; stdout log path, NONE for none; default AUTO -stdout_logfile_maxbytes=1GB ; max # logfile bytes b4 rotation (default 50MB) -stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) -directory=/home/zulip/deployments/current/ - -[program:zulip-events-digest_emails] -command=/home/zulip/deployments/current/manage.py process_queue --queue_name=digest_emails -priority=600 ; the relative start priority (default 999) -autostart=true ; start at supervisord start (default: true) -autorestart=true ; whether/when to restart (default: unexpected) -stopsignal=TERM ; signal used to kill process (default TERM) -stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10) -user=zulip ; setuid to this UNIX account to run the program -redirect_stderr=true ; redirect proc stderr to stdout (default false) -stdout_logfile=/var/log/zulip/events-digest_emails.log ; stdout log path, NONE for none; default AUTO -stdout_logfile_maxbytes=1GB ; max # logfile bytes b4 rotation (default 50MB) -stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) -directory=/home/zulip/deployments/current/ - -[program:zulip-events-email_mirror] -command=/home/zulip/deployments/current/manage.py process_queue --queue_name=email_mirror -priority=600 ; the relative start priority (default 999) -autostart=true ; start at supervisord start (default: true) -autorestart=true ; whether/when to restart (default: unexpected) -stopsignal=TERM ; signal used to kill process (default TERM) -stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10) -user=zulip ; setuid to this UNIX account to run the program -redirect_stderr=true ; redirect proc stderr to stdout (default false) -stdout_logfile=/var/log/zulip/events-email_mirror.log ; stdout log path, NONE for none; default AUTO -stdout_logfile_maxbytes=1GB ; max # logfile bytes b4 rotation (default 50MB) -stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) -directory=/home/zulip/deployments/current/ - -[program:zulip-events-embed_links] -command=/home/zulip/deployments/current/manage.py process_queue --queue_name=embed_links -priority=600 ; the relative start priority (default 999) -autostart=true ; start at supervisord start (default: true) -autorestart=true ; whether/when to restart (default: unexpected) -stopsignal=TERM ; signal used to kill process (default TERM) -stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10) -user=zulip ; setuid to this UNIX account to run the program -redirect_stderr=true ; redirect proc stderr to stdout (default false) -stdout_logfile=/var/log/zulip/events-embed_links.log ; stdout log path, NONE for none; default AUTO -stdout_logfile_maxbytes=1GB ; max # logfile bytes b4 rotation (default 50MB) -stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) -directory=/home/zulip/deployments/current/ - -[program:zulip-deliver-enqueued-emails] -command=/home/zulip/deployments/current/manage.py deliver_email -priority=600 ; the relative start priority (default 999) -autostart=true ; start at supervisord start (default: true) -autorestart=true ; whether/when to restart (default: unexpected) -stopsignal=TERM ; signal used to kill process (default TERM) -stopwaitsecs=30 ; max num secs to wait b4 SIGKILL (default 10) -user=zulip ; setuid to this UNIX account to run the program -redirect_stderr=true ; redirect proc stderr to stdout (default false) -stdout_logfile=/var/log/zulip/events-deliver_enqueued_emails.log ; stdout log path, NONE for none; default AUTO -stdout_logfile_maxbytes=1GB ; max # logfile bytes b4 rotation (default 50MB) -stdout_logfile_backups=10 ; # of stdout logfile backups (default 10) -directory=/home/zulip/deployments/current/ - - ; The below sample group section shows all possible group values, ; create one or more 'real' group: sections to create "heterogeneous" ; process groups. [group:zulip-workers] ; each refers to 'x' in [program:x] definitions -programs=zulip-events-user-activity,zulip-events-user-activity-interval,zulip-events-user-presence,zulip-events-signups,zulip-events-confirmation-emails,zulip-events-missedmessage_reminders,zulip-events-slowqueries,zulip-events-feedback_messages,zulip-events-digest_emails,zulip-events-error_reports,zulip-deliver-enqueued-emails,zulip-events-missedmessage_mobile_notifications,zulip-events-email_mirror,zulip-events-embed_links +programs=zulip-deliver-enqueued-emails, <% @queues.each_with_index do |queue, i| -%>zulip_events_<%= queue %><%= ',' if i < (@queues.size - 1) %> <% end -%> [group:zulip-senders] programs=zulip-events-message_sender