You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jul 16, 2021. It is now read-only.
Laravel has a great scheduling feature to allow you to manage cron jobs in your codebase, but one of the biggest problem's is when it comes to multiple machines.
Right now if you have 3 application servers behind a load balancer, you are forced to choose one that will initiate these cron jobs. If that server goes down your cron jobs won't execute. This is especially troublesome when you are using something like an auto-scaling group which can initiate / terminate instances at any time.
My proposal is to allow storing the cron's lock file in the cache (redis, memcached, etc) instead of storing it in the file system only.
That would allow you deploy all of your servers with the same cron configuration and the first server to get to a specific cron job would lock the others out and release when they are done. If a server goes down it's no longer a problem as any other server can pick up the slack and execute the cron jobs.
I started a pull request for this back in November but didn't have time to complete it with the limited free time I had. Before creating a new PR, I wanted to see what everyone else thought about this idea or if there were any better ways to accomplish this.
The text was updated successfully, but these errors were encountered:
Laravel has a great scheduling feature to allow you to manage cron jobs in your codebase, but one of the biggest problem's is when it comes to multiple machines.
Right now if you have 3 application servers behind a load balancer, you are forced to choose one that will initiate these cron jobs. If that server goes down your cron jobs won't execute. This is especially troublesome when you are using something like an auto-scaling group which can initiate / terminate instances at any time.
My proposal is to allow storing the cron's lock file in the cache (redis, memcached, etc) instead of storing it in the file system only.
That would allow you deploy all of your servers with the same cron configuration and the first server to get to a specific cron job would lock the others out and release when they are done. If a server goes down it's no longer a problem as any other server can pick up the slack and execute the cron jobs.
I started a pull request for this back in November but didn't have time to complete it with the limited free time I had. Before creating a new PR, I wanted to see what everyone else thought about this idea or if there were any better ways to accomplish this.
The text was updated successfully, but these errors were encountered: