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

francescotes1's avatar

Laravel Scheduler in Kubernetes context

Hello, i'm deploying a laravel project on Kubernetes and i'm using a container to run scheduled tasks using "php artisan schedule:work" as entryPoint. It seems to me that on the long run this may cause memory issues, in fact in our tests we had the scheduler container rebooting for oom after happily running for 1-2 months while not having exceptions of sort in our logs. What's your experience on running laravel scheduler in a kubernetes context and what's in your opinion the best way to make it run efficently?

Thank you

0 likes
4 replies
vincent15000's avatar

Sorry, I don't have the answer, I just follow the discussion.

Because I'm currently learning DevOps, I want to develop skills in this domain.

What is exactly Kubernetes for ?

francescotes1's avatar

Kubernetes is a container orchestration system, originally designed with microservices in mind, but flexible enough to support a wide variety of workloads.

It seems that no one with that knowledge + laravel is looking in there :(

Snapey's avatar

schedule:work is designed for local development and is not intended to be long running.

Typically, you would not add a scheduler cron entry to your local development machine. Instead, you may use the schedule:work Artisan command. This command will run in the foreground and invoke the scheduler every minute until you terminate the command.

Typically in production, you run the artisan schedule:run every minute with a crontab entry.

Please or to participate in this conversation.