Traccar database performance testing

Anton Tananaeva month ago

A long time ago we did some performance testing of different database options and MySQL was the winner back then. I decided to do another test to see if things changed since then. For the new test I used Hetzner Cloud with their lowest end ARM64 server (2 vCPUs, 4GB RAM, Ubuntu OS). I used performance testing script with 200 devices sending data with 1 second delay. So in a perfect scenario we should get 200 messages per second, but of course there are delays, mostly due to network and database latency. The results were surprising:

Installation Database Messages
Standard MySQL ~165/s
Docker MySQL ~165/s
Docker PostgreSQL ~175/s
Docker TimescaleDB ~175/s

Note that all tests were basically on an empty database, so it's not super representative of how it will perform once the database grows. But my bet is that TimescaleDB will perform the best in the long run. Starting from the next release we will officially support TimescaleDB, which is basically a time-series database plugin on top of PostgreSQL. It will automatically partition positions and events tables to be much more efficient.

We will do some more long term testing, but I think our recommendation going forward will be to use TimescaleDB with Traccar.

SwayDeva month ago

Thank you for sharing, looks promising.

For those already using MySQL, will it be possible to migrate to TimescaleDB?

Anton Tananaeva month ago

I haven't looked into any migration yet.

jafar habibia month ago

this is quite nice improvement.
what about storage size? does timescaleDB uses more storage than mysql?

Anton Tananaeva month ago

Why would it? It should be roughly the same.

jafar habibia month ago

does timescaleDB also enhances reports generation (trips, stops, ...). what do you think?

AgroTecha month ago

Dear Anton,
as we will create a new instance of Traccar using TimescaleDB extension over PostgreSQL, so can you provide some steps on config level especially after creating hypertable. and making the extension enabled on newly created traccar db?!
Thank you and it is look very promising.

Anton Tananaeva month ago
SwayDeva month ago

Trying to familiarize with TimescaleDB, and have a question.

Is it possible to use multinode to scale storage capacity?

Anton Tananaeva month ago

Not sure, but I'm assuming yes.

Dana month ago

+1 for interest in migration path from Mysql/MariaDB to PG/TimescaleDB

Basith8 days ago

Clearly PSQL is a winner here when combined with it’s other powerful features.