I am currently working on creating an environment to test application performance; I am testing MySQL and InnoDB to find out which ones can best serve us. In this environment, we will automatically prepare the database (load the existing dumps) and apply our test tools.
I am ready to test the same data dump with MySQL and InnoDB, but I can no longer bring the initial import into the usable part of InnoDB. The initial landfill took longer, but this did not bother me yet:
$ for i in testdb_myisam testdb_innodb; do time mysqldump --extended-insert $i > $i.sql; done real 0m38.152s user 0m8.381s sys 0m2.612s real 1m16.665s user 0m6.600s sys 0m2.552s
However, the import time was completely different:
$ for i in testdb_myisam testdb_innodb; do time mysql $i < $i.sql; done real 2m52.821s user 0m10.505s sys 0m1.252s real 87m36.586s user 0m10.637s sys 0m1.208s
After research, I came. Changing tables from MyISAM to InnoDB makes the system slow , and then set global innodb_flush_log_at_trx_commit=2 :
$ time mysql testdb_innodb < testdb_innodb.sql real 64m8.348s user 0m10.533s sys 0m1.152s
IMHO is still terribly slow. I also disabled log_bin for these tests and here is a list of all mysql variables .
Should I take these long InnoDB times or can they be improved? I have full control over this MySQL server, as it is exclusively for this test environment.
I can only apply custom configurations for initial import and modify them for application tests to better suit production environments.
Update:
Given the feedback, I turned off auto-messaging and various checks:
$ time ( echo "SET autocommit=0; SET unique_checks=0; SET foreign_key_checks=0;" \ ; cat testdb_innodb.sql ; echo "COMMIT;" ) | mysql testdb_innodb;date real 47m59.019s user 0m10.665s sys 0m2.896s
Speed โโhas improved, but not so. Is my test broken?
Update 2:
I managed to access another machine, the import was only about 8 minutes. I compared the configurations and applied the following settings to my MySQL installation:
innodb_additional_mem_pool_size = 20971520 innodb_buffer_pool_size = 536870912 innodb_file_per_table innodb_log_buffer_size = 8388608 join_buffer_size = 67104768 max_allowed_packet = 5241856 max_binlog_size = 1073741824 max_heap_table_size = 41943040 query_cache_limit = 10485760 query_cache_size = 157286400 read_buffer_size = 20967424 sort_buffer_size = 67108856 table_cache = 256 thread_cache_size = 128 thread_stack = 327680 tmp_table_size = 41943040
With these settings, I reached about 25 minutes. Itโs still far from the few minutes MyISAM takes, but it becomes more convenient for me.