Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

nsassert's avatar

Replacing Cron with a More Reliable Service for Scheduled Tasks

Hello,

I am looking to replace my current virtual machine setup that uses cron for firing scheduled tasks in the Kernel. I have been experiencing issues with the reliability of the cron machine, especially since I am using containers. It has failed several times, and I need a more dependable solution.

I am considering switching to a simple HTTP request from an external service that will hit my app every minute and schedule the tasks. However, I am open to other suggestions for production-ready alternatives.

Please share any ideas or recommendations you have for a more reliable service that can handle scheduled tasks efficiently.

Thank you!

0 likes
7 replies
Snapey's avatar

The problem is with your container not cron.

Yes, you could do as you suggest, but you end up with a more complex solution, which is dependent on a third party service being up and running.

You also limit max execution time of your scheduled jobs to be the same as your http request max execution

You might also need to consider possibly being called more than once in any given minute if the URL you are using becomes known to web crawlers (causing jobs to run more than once)

Some options;

You could monitor your cron setup with

1 like
nsassert's avatar

@Snapey agree I was thinking about running all the jobs in the background so that the execution time wouldn't be a problem, I guess.

The problem is that I need to maintain another virtual machine just with a simple cron scheduler. Cron pushes everything to the queue anyway.

I could protect the API with some key or secret to not allow calls from outside.

I wonder how large apps that are on the cloud and need a clear scaling path handle cron jobs.

JohnnyBigodes's avatar

If you are using containers this could help you.

A very good alternative to cron is, supercronic:

https://github.com/aptible/supercronic

Another very good alternative, but only for the scheduler:

https://github.com/mcuadros/ofelia

There are several way to handle this when using containers...

  1. A container with supervisor installed, that starts the queue and the scheduler.

  2. A multipurpose image that can start a fpm container, queue container and scheduler container.

https://laravel-news.com/laravel-scheduler-queue-docker

Both ways are valid, but I prefer #2 because you can scale on demand.

1 like

Please or to participate in this conversation.