Batch collisions: finding and spreading out jobs that share a minute
One-line answer: Why schedules that look independent pile onto the same minute, and how a heatmap finds the collisions worth fixing.
Batch jobs are usually written one at a time, and each one knows nothing about the others. When they land on the hour, on 02:00, or on every fifteenth minute, database connections, disk I/O and API quotas are consumed at the same instant. The result is batches that are mysteriously slow rather than broken.
Finding collisions
Expand every registered schedule into occurrence times in one time zone, then count how many jobs run in each minute. Out of 1,440 minutes a day, the ones with two or more jobs are collisions. A seven-day by twenty-four-hour heatmap makes the shape obvious; CronPulse's detector also lists the collision windows by name.
Common patterns
| Pattern | Cause | Fix |
|---|---|---|
| Top of the hour | Every job uses 0 * * * * | Scatter minutes: 5, 17, 29 |
| 02:00 pile-up | Everyone picks “the quiet hour” | Spread across 00:00–05:00, keep dependencies in order |
| Fifteen-minute grid | Several */15 jobs | Offset some to 7, 23 or 41 |
| Month start | Settlement, billing, reports | Spread across the 1st, 2nd and 3rd |
0 * * * * top of every hour - collision risk
7,22,37,52 * * * * offset from the 15-minute grid
0 2 * * * 02:00 backup
17 3 * * * moved to 03:17
What not to break
Spreading times can break assumptions such as “this job always runs first”. Express dependencies explicitly and trigger downstream work from the upstream completion event rather than from the clock. Give external APIs a minimum gap between calls, and put low-quota services behind their own queue.
Observe the effect
Record start, end and duration for every job on one clock (UTC recommended). If jobs that start in a crowded hour take longer on average than the same jobs in a quiet hour, collisions are the likely cause.
A small habit
Check the collision heatmap whenever a batch is added. Register the live schedules once in CronPulse and compare the collision count before and after each deployment.
Paste an expression and see its next run times right away.
Open CronPulseFrequently asked questions
Do I have to reschedule every job to remove collisions?
No. Moving a few of the heaviest jobs usually fixes most of it. Start with the busiest hour and the jobs that share a database or an external API.
Are overlapping jobs always a problem?
Not always. Several light jobs can share a minute safely. Prioritise overlaps between jobs that compete for the same database, disk or rate-limited API.
Sources
Related reading
- Cron in five fields: minute, hour, day, month, weekdayWhat each of the five Unix cron fields means, which values are allowed, and how to read an expression without guessing.
- Cron special characters: *, /, -, commas, ?, L, W and #The eight symbols that make cron expressive, what each one means, and where implementations disagree.
- Five-field Unix cron versus six-field Quartz and EventBridgeSeconds, weekday numbers, the ? rule and the year field: what changes when you move a schedule between cron dialects.
- Daylight saving and cron: the day 02:30 disappearsHow clock changes affect cron runs, and how to move jobs out of the 2–3 AM danger window.