Executing Cron Scripts Reliably At Scale
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.
Related posts
- Scaling to 1 million concurrent sandboxes in seconds
Modal mediumAdept
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. A horizontally scaled fleet of scheduling servers picks workers using in-memory state that workers publish to a Redis stream, then calls the worker directly over RPC; workers act as their own source of truth and reject requests when full. Kubernetes and Modal's old Postgres-backed design hit limits from O(pods) and O(nodes) etcd and Postgres writes and serialized scheduling. The new path takes two network hops, scheduling takes tens of milliseconds, and median start time is under 0.5s, with tail latency driven by kernel rtnl lock contention during container networking setup.
- Slowing Down to Speed Up – Circuit Breakers for Slack’s CI/CD
Slack Engineering mediumAdeptSlack 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. CI/CD request volume grew about 10% month over month, and vertical and horizontal scaling had stopped keeping up. Checkpoint's background jobs query dependent-service health in Prometheus through Trickster. When thresholds are exceeded, the breakers open, deferring or shedding test jobs, and they close again when the services recover. The Hacklang implementation drops the half-open state because job retries and cached TTL queries handle recovery, fails closed when metric lookups error, and notifies engineers whenever a breaker changes state.
- Run Scheduled and Recurring Tasks with Cron
Railway mediumAdeptCron 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. The guide covers the five-field schedule syntax, including the day-of-month/weekday OR pitfall and timezone/DST issues, and recommends idempotent upserts, structured start/success/error logs, explicit connection cleanup, and Postgres advisory locks to prevent overlapping runs. On Railway, cron triggers a service's start command in UTC with a 5-minute minimum interval and a single active execution. A process left alive by open handles or pending promises causes later runs to be skipped.
- Keep the monolith, but split the workloads
incident.io mediumAdeptA 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. After a bad Pub/Sub message caused an unhandled panic that crashed the web, worker and cron threads together for 32 minutes, incident.io split them into independent Heroku dyno tiers selected by command-line flags. They also gave each class of work its own capped Postgres connection pool and statement timeout, so low-priority jobs such as BigQuery event export or best-effort nudges fall behind rather than exhausting the shared database. The main migration hazard is code that assumes a shared process, such as process-local caches, and the fix is to move that coordination into Postgres or Redis.
- How we tripled max concurrent jobs to boost performance of GitHub Actions
GitHub Engineering mediumAdeptGitHub 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. A hot path for workflow secrets and callback URLs had silently never used its cache, which only showed up in profile traces. Orchestration state moved from a single growing blob column to a per-event table with incremental reads and writes, cutting orchestration CPU by about 50%. Postback load to the Rails checks service was reduced by deferring step updates until run completion and removing duplicate completion events, with a message queue planned to replace the multi-hop HTTP delivery.