TokuDB vs InnoDB in timeseries INSERT benchmark

September 5, 2013
Author
Vadim Tkachenko
Share this Post:

TokuDBThis post is a continuation of my research of TokuDB’s storage engine to understand if it is suitable for timeseries workloads.

While inserting LOAD DATA INFILE into an empty table shows great results for TokuDB, what’s more interesting is seeing some realistic workloads.

So this time let’s take a look at the INSERT benchmark.

What I am going to do is to insert data in 16 parallel threads into the table from the previous post:

The INSERTS are bulk inserts with sequentially increasing ts and with sensor_id from 1 to 1000.

While the inserts are not fully sequential, because the primary key is (sensor_id, ts), it is enough to have in memory workload, so I do not expect performance degradation when data exceeds memory. This will play in favor for InnoDB, as it is known that TokuDB performs worse in CPU-bound benchmarks.

The benchmark executes 1mln events, each event inserts 1000 records in bulk. That is when finished we should about about 1 bln records in the table.

So let’s see how InnoDB (compressed 8K vs not compressed) performs.
Throughput (more is better):
innodb-thr

Response time (log 10 scale on the axe Y) (less is better):
innodb_resp

So InnoDB comes with following numbers:

 

    • InnoDB no compression. Averages at 350 inserts/sec with response time 80-100ms per transaction. The final table size is 82GB

 

    • InnoDB 8K compression. Throughput is 130 inserts/sec, response time 250ms. Table size is 60GB

 

Now, we have a quite bad compression rate, because I used uniform distribution for values of data1-data5 columns, and uniform may not be good for compression. And actually in the real case I expect much more repeating values, so I am going to re-test with pareto (zipfian) distribution.

For TokuDB (tested tokudb_fast and tokudb_small formats)

Throughput (more is better):
tokudb_thr

Response time (log 10 scale on the axe Y) (less is better):
tokudb_resp

TokuDB observations:

 

    • After an initial warmup TokuDB shows quite inconsistent performance with both tokudb_fast and tokudb_small formats

 

    • For tokudb_fast, the throughput is topping at ~150 inserts/sec, and 95% response time ~160 ms. However there are periodical stalls when throughput drops almost to 0 and response time jump to 10 sec !!! per transaction.

 

    • For tokudb_small, the throughput even less stable jumping around 100 inserts/sec and response time starts from 300ms per transactions with stalls up to 30 sec per transaction

 

File sizes for TokuDB: tokudb_fast: 50GB, tokudb_small: 45GB. Again I correspond a bad compression rate to uniform distribution. If we switch to pareto, the file size for tokudb_fast is 21GB, and for tokudb_small is 13GB

If we zoom in to 900 sec timeframe we can see periodic behavior of TokuDB:
zoom

Now I consider these stalls in TokuDB as severe and I do not think I can recommend to use it in production under such workload conditions until the problem is fixed.

The scripts for the timeseries benchmark for sysbench v0.5 you can find there
https://github.com/percona/sysbench-scripts

Software versions, for InnoDB: Percona Server 5.6-RC3 , for TokuDB: mariadb-5.5.30-tokudb-7.0.4

UPDATE (5-Sep-2013):
By many requests I update the post with following information:
TokuDB throughput (tokudb_small row format) with Pareto distribution, for two cases:

 

    • 1. PRIMARY KEY (sensor_id,ts) (on graph: tokudb_small)

 

    • 2. PRIMARY KEY (ts,sensor_id), KEY (sensor_id,ts) (on graph: tokudb_small_key)

 

Throughput in this case:
tokudb_key

We can see that top throughput for tokudb_small_key is less then for tokudb_small, but there is also less variance in throughput.

The my.cnf files.
For InnoDB

for TokuDB (pretty much defaults)

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments

Far
Enough.

Said no pioneer ever.
MySQL, PostgreSQL, InnoDB, MariaDB, MongoDB and Kubernetes are trademarks for their respective owners.
© 2026 Percona All Rights Reserved