by djantje · 3y ago · 0 comments
innodb_file_per_table=ON
InnoDB supports database transactions, so you/an update/insert can use rollback, which MyIsam and Aria tables can not do (they work like auto commit)
they work like auto commit
Which makes the code way simpler and performance way higher.This whole thread reads like a few folks tried some setup without bothering to turn a single nerd knob and then complained about the results.
Innodb > myisam in any case where you’re actually inserting.
So what happens with InnoDB as writes increase is that eventually you get freezes while the disk view catches up, which frees up journal space so it can go on another writing spree. If you try to shut down the database during one of these freezes it hangs. If you force it to restart anyway, it immediately freezes again on restart... until it frees up some journal space. Paradoxically in this case you have to decide how long of a freeze you can tolerate and reduce the size of the journal(s) accordingly.
MyISAM doesn't write the journal, so it doesn't have journal writes. "Half as many writes" is the best case, in practice there are additional writes pertaining to indexes. (You can be even more clever and disable updating indexes or even drop all indexes and re-create them after all table writes are completed. You can even write to some temp table, build the indexes on it, then rename it to the actual table; or fail over to a new node with the refreshed tables.)
Everything I know about tuning InnoDB I learned tuning DEC RDB (based on the KODA engine, Oracle bought RDB to get the KODA engine for its distributed locking implementation), not much has changed in 30+ years.
I have been sitting together with folks whose life is configuring MySql and they couldn't tune InnoDB to match the performance of MyIsam.
This was for an application which did a long running numbercrunching job on a large database with a mix of inserts/updates/selects.
Might be different for other types of workloads. But for this workload, InnoDB did not stand a chance even with a lot of tuning.
For initial bulk file loads using mysqlsh [0], MyISAM doesn't stand a chance because it takes a table lock, so the tool can't parallelize the import like it can with InnoDB.
I wrote a small script to test this [1]. tl;dr 12,500,000 rows totaling 2.75 GB took 6 min 57.2374 sec at 6.59 MB/s for InnoDB, and 11 min 18.4550 sec at 4.05 MB/s for MyISAM. During the test, whereas the InnoDB load utilized multiple cores, the MyISAM load only saturated a single core.
Now, normal INSERTs are likely another story. Working on that test now.
[0]: https://dev.mysql.com/doc/mysql-shell/8.0/en/mysqlsh.html
[1]: https://gist.github.com/stephanGarland/06ff4820f99e5966ba097...