# Bad TokuDB insert/replace speed

**URL:** <https://forums.percona.com/t/bad-tokudb-insert-replace-speed/5860>\
**Category:** Percona Server for MySQL 5.7\
**Created:** [September 12, 2017, 6:47pm UTC](https://forums.percona.com/t/bad-tokudb-insert-replace-speed/5860 "2017-09-12T18:47:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Javier.Medina](https://avatars.discourse-cdn.com/v4/letter/j/3bc359/32.png) [@Javier.Medina](https://forums.percona.com/u/Javier.Medina)\
**Post date:** [September 12, 2017, 6:47pm UTC](https://forums.percona.com/t/bad-tokudb-insert-replace-speed/5860/1 "2017-09-12T18:47:26Z")

</div>

Greetings, I’ve just replaced an MySQL 5.7 with Percona 5.7.19-17 looking to replace InnoDB tables with TokuDB ones.

The server is a humble on (tight budget): 6 Cores - Centos 6.9, 8GB RAM with HDD 500GB for a database of about 70GB (data+index in InnoDB).

I wanted to try tokudb for the compression (to add an SSD of 128GB for the database), for the insertion speed and the concurrency. I was very pleased with the time it took to convert the biggest tables from InnoDB to TokuDB and the verbosity of the process, but after the conversion, the daily loading process run in the TokuDB tables tooooo slow. With InnoDB obtained in the order of 120/250 insertions per second, and with TokuDB went to 20/25 insertions per second. There is something very wrong with the configuration, but can’t figure what.

The my.cnf is very simple:

[mysqld]  
lower\_case\_tablenames=1  
skip-name-resolve

query\_cache\_size = 0  
key\_buffer\_size=268435456

innodb\_ft\_sort\_pll\_degree = 3  
innodb\_log\_file\_size = 3072M  
innodb\_buffer\_pool\_size = 3072M  
innodb\_flush\_log\_at\_trx\_commit = 2  
innodb\_flush\_method = O\_DIRECT

I noticed when inserting into InnoDB tables, the disk reached 50% usage, but with TokuDB insertions got the disk at 100%.

SELECT querys run a tad faster, I’ve yet to change the index schema to exploit TokuDB advantages, but first I need to fix the loading time. Where should I begin tweaking?

Any advice is valued (sorry for the english)… Thanx.
