When Background Jobs Collide
The CMS kept slowing down on a schedule, especially overnight, and no single job looked guilty. Lined up on a clock, the jobs told a different story: every 30 minutes, three of them started at the same time.
Slowdowns with no obvious culprit
Our authoring server, the one editors and integrations work against, kept going through recurring rough patches. Nothing was obviously broken. Each scheduled job, looked at by itself, seemed reasonable.
When nothing looks guilty on its own, it's worth asking what everything looks like together.
Put the jobs on one clock
Three recurring jobs were doing heavy work on the same server:
- A product data import, every 15 minutes.
- A content import for all brands, every 15 minutes.
- A product finder rebuild, every 10 minutes.
:00 product import + content import + finder rebuild :10 finder rebuild :15 product import + content import :20 finder rebuild :30 product import + content import + finder rebuild :40 finder rebuild :45 product import + content import :50 finder rebuild
The math nobody planned
Two jobs on the same 15-minute schedule don't just overlap sometimes. They start together every single time. And a 10-minute job lines up with a 15-minute job every 30 minutes, the first time both schedules agree.
So twice an hour, all three heavy jobs kicked off at once, competing for the same CPU, memory, database, and search index. None of the schedules was wrong by itself. Together, they guaranteed a pile-up.
What I recommended
- Stagger the start times so the jobs don't share a minute, for example offsetting one import by a few minutes.
- Ask whether each job really needs to run that often, especially overnight.
- Measure server load around the scheduled times before and after any change, so the result is evidence, not a feeling.
Where it stands
I identified the overlap as a likely contributor to the load, not a proven sole cause. I don't have evidence that the schedules have been changed yet, or that the slowdowns stopped, so I'm not claiming either.
What the analysis did was turn "the server is slow sometimes" into a specific, testable idea with an easy experiment attached.
What I took away
- Look at scheduled jobs together, not one at a time.
- Schedules that share a common multiple will collide on a predictable rhythm.
- Reasonable settings can add up to an unreasonable load.
- A likely cause is a hypothesis until you change something and measure.