Sample Header Ad - 728x90

MariaDB 10.6 InnoDB setttings for unit-tests: maximize performance at the expense of persistence

0 votes
2 answers
431 views
I have a **MariaDB 10.6** the db is used for phpunit tests. The database is dropped and recreated each time I run the unit tests. I would like to maximize the speed of the interactions (read/write) with this db while I totally don't care about persistence. I was thinking of converting all tables to MEMORY engine, I can't find detailed infos about this engine on [mariadb docs](https://mariadb.com/kb/en/memory-storage-engine/) , but the [mysql docs](https://dev.mysql.com/doc/refman/8.0/en/memory-storage-engine.html) says that TEXT/BLOB fields are not supported as well as transactions. So, no way. I was thinking of converting the tables to TEMPORARY tables, but this was based on the false belief that they are stored in RAM. I came across the idea of [running InnoDB on RAM](https://ultrahigh.org/2013/03/running-mysqlinnodb-in-memory-for-unit-tests/) setting --datadir=/dev/shm/mysql/, but elsewhere I read that this is not a good idea 'cause MariaDB won't be able to handle a reboot. So I think that the best thing to do is to tweak InnoDB settings to maximize performance at the expense of persistence. I saw [this answer](https://dba.stackexchange.com/questions/167883/optimizing-mysql-5-6-for-unit-tests) but it refers to MySQL 5.6 and a lot of things changed in InnoDB since that release. What settings do you recommend?
Asked by nulll (151 rep)
Aug 17, 2022, 07:07 AM
Last activity: Aug 20, 2022, 05:19 PM