Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

running on multiple server instances #19

Closed
oliverkaiser opened this issue Apr 12, 2014 · 1 comment
Closed

running on multiple server instances #19

oliverkaiser opened this issue Apr 12, 2014 · 1 comment
Assignees
Labels

Comments

@oliverkaiser
Copy link

I would like to use this package for a site which will run on multiple ec2 instances of amazon web services behind a load balancer. Now I see two options:

  • Integrate the crontab setup within my deploy script to setup the cron on every instance. How do I prevent multiple executions at the same time / overlapping ?
  • Setup an external server to call the route from outside and the loadbalancer chooses an instance on which it will be executed. ( I think this could work but isn't that nice in my opinion )

What do you think? What is the way to go?

@liebig
Copy link
Owner

liebig commented Apr 14, 2014

Hi kaiserlos,

thanks for using Cron. What should the Cron jobs do? Is it necessary that this jobs run on all server instances or can one server handle this?

If you choose your first option, the Cron jobs would be executed multiple because Cron has an overlapping protection but this works on file system basis. To prevent overlapping a database should be used for detecting the Cron run.

Your second option sounds good for me. The overlapping protection would not work either (because of the load balancing) but only one Cron will run on the same time. If your Cron jobs perform heavy load, the load balancing works great here and would choose the best server to execute the jobs. I would prefer this option.

If you have further questions don't hasitate to ask.

Many greetings
Marc

@liebig liebig self-assigned this Apr 14, 2014
@liebig liebig closed this as completed Apr 29, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants