From f0c6b635261b1f5d545ac22789bb746eccc055f1 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 20 Nov 2013 14:26:04 -0500 Subject: [PATCH] [puppet] Add cron job to restart our workers daily. This is to ensure that if we have an interval where we're not doing prod deploys, we don't have to worry about worker memory leaks killing us. (imported from commit 0b0180b0751f6c618d877b9c9ffc2b8287254e4d) --- puppet/zulip_internal/files/cron.d/restart-workers | 5 +++++ puppet/zulip_internal/manifests/app_frontend.pp | 7 +++++++ 2 files changed, 12 insertions(+) create mode 100644 puppet/zulip_internal/files/cron.d/restart-workers diff --git a/puppet/zulip_internal/files/cron.d/restart-workers b/puppet/zulip_internal/files/cron.d/restart-workers new file mode 100644 index 0000000000..c9cfd02d57 --- /dev/null +++ b/puppet/zulip_internal/files/cron.d/restart-workers @@ -0,0 +1,5 @@ +MAILTO=root + +# Restart all of our Django workers at 7:37AM every day +# This is to handle the fact that we have memory leaks. +37 7 * * * zulip supervisorctl restart zulip-workers:* diff --git a/puppet/zulip_internal/manifests/app_frontend.pp b/puppet/zulip_internal/manifests/app_frontend.pp index 73b5d06d8f..a04f355f82 100644 --- a/puppet/zulip_internal/manifests/app_frontend.pp +++ b/puppet/zulip_internal/manifests/app_frontend.pp @@ -19,4 +19,11 @@ class zulip_internal::app_frontend { notify => Service["nginx"], } + file { "/etc/cron.d/restart-workers": + owner => "root", + group => "root", + mode => 644, + source => "puppet:///modules/zulip_internal/cron.d/restart-workers", + } + }