0

I'm trying to improve the performance of our server. We have 1 server with around 25 tenants, each tenant has it's own application instance and database. There are no performance issues, until, each instance starts it's cron job every 10 minutes. Everytime this happens the CPU spikes to 90%, we would like to fix this.

A solution we came up with ourself is adding a service to the server which would act as a queue-handler. Each application instance would submit it's task to the queue and they will run one after another, or maybe a couple simultaneously. Using this method we could also implement some sort of priorities.

So far we can't find a case like this, so we would like to hear your opinion, some advise or maybe your experience.

1

Your solution idea would likely work, and it may be the most flexible, although you'd need to take care that no application can starve the others.

Another, possibly simpler, approach would be to run the 10-minute cron jobs in a staggered sequence: each instance runs its cron task 24 seconds after the previous, so each gets essentially 1/25 of the available 10 minute cycle.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.