Why I Stopped Trusting Request-Based Schedulers
WordPress's WP-Cron teaches a hard lesson: event-driven scheduling breaks at scale. I learned this the painful way.
I inherited a WordPress site doing ~10k monthly visitors. Backup plugin kept failing. Scheduled posts published at random times. WooCommerce abandoned cart emails never sent. The client thought it was all broken.
Turned out WP-Cron was the culprit. That "scheduler" doesn't actually schedule anything—it hijacks HTTP requests and prays someone visits the site. Low traffic? Tasks don't run. Traffic spike? Everything piles up at once. Broken.
This shaped how I think about scheduling now.
When I built Seven CMS, I didn't touch request-based jobs. Same with my ERPNext customizations—critical tasks (invoicing, stock updates, notifications) can't depend on user traffic patterns. That's asking for data corruption.
I've seen this pattern destroy production systems:
Legacy apps with hidden cron dependencies: Some monolithic PHP codebase from 2008 has 15 jobs baked into session cleanup. Nobody documents it. Move the app to a cloud provider without proper cron setup? Everything breaks silently.
High-traffic sites that are too successful: I consulted on a SaaS hitting scale. WP-Cron variants meant their cleanup jobs spawned hundreds of concurrent processes during peak hours. Database melted. The fix: actual cron jobs running at 3 AM.
Microservices thinking gone wrong: Some teams assume "someone" will call that API endpoint to trigger cleanup. They won't. Then you're debugging data leaks in production.
The lesson: Separate event scheduling from request handling. Always.
For modern stacks:
- Use Redis queues + workers (Node.js/PHP both solid here)
- Deploy proper cron infrastructure (Docker sidecars, Kubernetes cronjobs)
- Or outsource to services designed for this (Bull, Celery, AWS EventBridge)
For legacy systems stuck on WordPress or old PHP: Set up proper system cron. Not application-level fakes. System-level.
The cost is minimal. The pain of debugging why "something sometimes doesn't run" is astronomical.
I've stopped accepting "but it worked for years" as an excuse. It seemed to work. You just got lucky with traffic patterns.