Cron in a Cluster

Cron in a Cluster

by R.T. Brown -
Number of replies: 3

How do folks manage cron in a clustered environment? If you have three web servers, do you have cron intermittently on each, or just one?

Thank!

Average of ratings: -
In reply to R.T. Brown

Re: Cron in a Cluster

by Andrew Lyons -
Picture of Core developers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Testers

Strange things can happen if you run multiple crons at once - avoid!

In our architecture, we have five web servers, two database servers, two load balancers (software), and a dedicated cron server.

Our cron server runs cron every few minutes using the CLI cron, and also handles a number of other related tasks like enrolment, synchronisation with our MIS, synchronsiation with our flash media server, etc.

There is also a proposal to allow Moodle to handle asynchronous backup and restore, and we will also run the backend processes on our cron server for this.

Andrew

In reply to Andrew Lyons

Re: Cron in a Cluster

by J S -

If you want to run cron against multiple servers, you need to have some sort of locking mechanism to prevent multiple cron processes from running in parallel.  Its not terribly hard to do and then you get the benefit of not having to run cron against one server only (or dedicate a server).

 

In reply to Andrew Lyons

Re: Cron in a Cluster

by R.T. Brown -

Andrew,

Many thanks for the response. I now have it running on only one using the CLI as well. My next challenge is to remove said server from student traffic.

rtb