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.
Thank you for sharing, looks promising.
For those already using MySQL, will it be possible to migrate to TimescaleDB?
I haven't looked into any migration yet.
this is quite nice improvement.
what about storage size? does timescaleDB uses more storage than mysql?
Why would it? It should be roughly the same.
does timescaleDB also enhances reports generation (trips, stops, ...). what do you think?
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.
Trying to familiarize with TimescaleDB, and have a question.
Is it possible to use multinode to scale storage capacity?
Not sure, but I'm assuming yes.
+1 for interest in migration path from Mysql/MariaDB to PG/TimescaleDB
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:
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.