Task Scheduling with Horizontal Scaling

mason chak a year ago

Hi everyone,

I've come across a question regarding task scheduling.

Traccar has a task expiration that is scheduled to run every hour of the day. When running Traccar on a single server, this task works perfectly fine. However, I'm planning to scale our system horizontally by adding multiple servers.

My concern is, with multiple servers in a horizontally scaled environment, will this task run on each server separately, potentially causing redundant executions? How does Traccar handle task scheduling in such a setup to ensure that the task is only executed once per hour across all servers?

if not how can i make it to execute in just one server?

Anton Tananaev a year ago

Good point. I don't think we handle that currently.

mason chak a year ago

What do you suggest to solve this issue and handle the task to execute just one?

Anton Tananaev a year ago

One option is to have a main server that would handle those tasks.