TGViewer
samdark blog ☕️ (Alexander Makarov) samdark blog ☕️ (Alexander Makarov) @samdark_blog · 1.61K subscribers
Post #429 702
⏰ You likely don't need a PHP scheduler

The topic was raised again for Yii3 about having a scheduler package. Schedulers are common: both Laravel and Symfony have one. But in most cases, you don't need it.

Laravel runs schedule:run from cron every minute. schedule:work just replaces cron as the trigger. Either way, the framework boots 1440 times a day, mostly to find nothing to do.

Symfony uses a worker that never stops instead, which is one more process to watch, restart after deploys, and keep from leaking memory. Way better, but still not really necessary.

The main argument for these is "the schedule is in the repository". But a crontab file can be there as well, and cron tools already cover the features:

- No overlap: flock -n.
- Missed runs: anacron, or systemd timers with Persistent=true.
- Monitoring: ping your monitoring service from the command.
- Containers: supercronic.

PHP-based schedulers also have a significant drawback: both run tasks one by one by default. You need runInBackground or a queue to fix that. Cron starts all the 8:00 jobs at 8:00.

A scheduler makes sense for tasks that run more often than once a minute, schedules stored in a database, one-server execution with failover, or hosting without cron.

Otherwise, just use cron.

What do you think about PHP schedulers?

#php #cron #laravel #symfony #devops #yii3 #yii
GitHub New package proposal: yiisoft/schedule — recurring tasks for Yii 3 · yiisoft · Discussion #530 At work we are migrating a large project from Yii 2 to Yii 3, and one capability we lost in the move is scheduling: omnilight/yii2-scheduling (316 stars, 1.1M downloads) hard-requires yiisoft/yii2,...
  • 👍 14
  • 🔥 4
  • 💯 2
  • 👀 1
More from @samdark_blog
  1. Oct 1, 2026🔶 Стратоплан - Технический директор. Управление технологиями и людьми - №1 Давно хотел уп…
  2. Sep 29, 2026⚖️ Cost of failure The cost of failure is very different in different projects. Many thing…
  3. Sep 28, 2026🚀 Benchmarking YiiPress vs Hugo I love Hugo, ran a blog on it for some time and it was wh…
  4. Sep 28, 2026Компилируемый PHP: перспективы и возможности 👤 Дмитрий Dantes Первый доклад Пыхник’26 — о…
  5. Sep 27, 2026💡 Feedback loop on quality gate LLM outputs can be wrong both randomly and consistently.…
  6. Sep 27, 2026Fear is the mind-killer “I must not fear. Fear is the mind-killer. Fear is the little-deat…
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →