---
title: "Executing Cron Scripts Reliably At Scale"
description: "Slack replaced a single cron box running all scripts from one crontab with a distributed cron execution service built mostly from existing infrastructure."
url: "https://swe.quest/articles/executing-cron-scripts-reliably-at-scale-300d2911de10f9b3"
canonical: "https://slack.engineering/executing-cron-scripts-reliably-at-scale/"
source: "Slack Engineering"
published: "2023-09-28"
difficulty: "medium"
kind: "Case study"
reading_minutes: 5
tags: ["scheduling","system-design","kubernetes","go","messaging"]
---

# Executing Cron Scripts Reliably At Scale

A post on [Slack Engineering](https://swe.quest/sources/slack.md), published 2023-09-28, 5 min read, Case study. Original: [https://slack.engineering/executing-cron-scripts-reliably-at-scale/](https://slack.engineering/executing-cron-scripts-reliably-at-scale/)

## Summary

Slack replaced a single cron box running all scripts from one crontab with a distributed cron execution service built mostly from existing infrastructure. A Go "Scheduled Job Conductor" on Kubernetes (Bedrock) uses leader election so one pod schedules while standby pods wait to take over, and it avoids shutting down at the top of a minute. The heavy work is offloaded to Slack's Kafka/Redis-backed Job Queue, which runs about 9 billion jobs a day. A Vitess table records each run's state, replacing flock-based locking for deduplication and backing a status page for engineers. The team chose a single active scheduler over synchronizing multiple nodes because leader failover is fast and scripts don't execute on the scheduler itself.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Scheduling](https://swe.quest/tags/scheduling.md) (Distributed systems)
- [System design](https://swe.quest/tags/system-design.md) (Architecture & design)
- [Kubernetes](https://swe.quest/tags/kubernetes.md) (Infrastructure)
- [Go](https://swe.quest/tags/go.md) (Languages)
- [Queues & messaging](https://swe.quest/tags/messaging.md) (Backend & APIs)

## Prerequisites

- cron syntax
- Kubernetes basics ([easy posts on Kubernetes](https://swe.quest/tags/kubernetes.md?difficulty=easy))
- job queues ([easy posts on Queues & messaging](https://swe.quest/tags/messaging.md?difficulty=easy))

## Keywords

Scheduled Job Conductor, Bedrock, Kubernetes Leader Election, Slack Job Queue, Vitess, Kafka, Redis, flock

## Related posts

- [Scaling to 1 million concurrent sandboxes in seconds](https://swe.quest/articles/scaling-to-1-million-concurrent-sandboxes-in-seconds-44dad4f83cd974c1.md): Modal · 2026-07-16 · Medium · 10 min read · Scheduling, Scaling, Sandboxing & isolation, Distributed systems, Containers
  Modal rebuilt its sandbox control plane to run 1 million concurrent sandboxes, creating all of them in under a minute, by removing central coordination and durable stores from the creation path.
- [Slowing Down to Speed Up – Circuit Breakers for Slack’s CI/CD](https://swe.quest/articles/slowing-down-to-speed-up-circuit-breakers-for-slack-s-ci-cd-9aadbea59ffc838e.md): Slack Engineering · 2022-08-19 · Medium · 16 min read · Resilience, CI/CD, Developer productivity, Observability
  Slack added orchestration-level circuit breakers to Checkpoint, its CI/CD orchestration service, to stop cascading failures between internal systems such as GitHub Enterprise, Jenkins, test environments, Flannel, Vitess and search.
- [Run Scheduled and Recurring Tasks with Cron](https://swe.quest/articles/run-scheduled-and-recurring-tasks-with-cron-ca49b6813f0599a8.md): Railway · 2025-11-26 · Medium · 10 min read · Scheduling, Deployment, PostgreSQL
  Cron runs commands on time-based schedules but keeps no job history, has no retries and does no concurrency control, so reliability depends on the job itself.
- [Keep the monolith, but split the workloads](https://swe.quest/articles/keep-the-monolith-but-split-the-workloads-a46b5ee6a5f1e352.md): incident.io · 2023-04-12 · Medium · 9 min read · Resilience, System design, PostgreSQL, Go, Microservices
  A Go monolith can get much of the reliability isolation of microservices by splitting workloads into separate deployments of the same binary, instead of breaking it into services.
- [How we tripled max concurrent jobs to boost performance of GitHub Actions](https://swe.quest/articles/how-we-tripled-max-concurrent-jobs-to-boost-performance-of-github-actions-9d54244cd033cdac.md): GitHub Engineering · 2022-09-16 · Medium · 5 min read · Performance engineering, Scaling, CI/CD, Caching
  GitHub Actions on GitHub Enterprise Server went from 2,200 to 7,000 max concurrent jobs on 96-core machines between GHES 3.2 and 3.6 through three main fixes.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
