Traccar database performance testing

Anton Tananaev10 days 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.

SwayDev9 days ago

Thank you for sharing, looks promising.

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

Anton Tananaev9 days ago

I haven't looked into any migration yet.

jafar habibi9 days ago

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

Anton Tananaev9 days ago

Why would it? It should be roughly the same.

jafar habibi9 days ago

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

AgroTech9 days 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 Tananaev9 days ago
SwayDev8 days ago

Trying to familiarize with TimescaleDB, and have a question.

Is it possible to use multinode to scale storage capacity?

Anton Tananaev8 days ago

Not sure, but I'm assuming yes.

Dan4 days ago

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