Bug #93684 | mysql innodb dump restore slows down after upgrade mysql 5.7 to 8.0 | ||
---|---|---|---|
Submitted: | 19 Dec 2018 12:28 | Modified: | 21 Jan 2019 13:17 |
Reporter: | Florian Kopp | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: mysqldump Command-line Client | Severity: | S5 (Performance) |
Version: | 8.0.13 | OS: | Debian (9.6 Stretch) |
Assigned to: | CPU Architecture: | x86 (Intel CPU) | |
Tags: | mysql-8.0, mysqldump, mysqlrestore |
[19 Dec 2018 12:28]
Florian Kopp
[19 Dec 2018 12:48]
Florian Kopp
there is a typo in the decription: innodb_buffer_pool_size is 1024M on a 2G RAM VM and not 2048M.
[19 Dec 2018 14:28]
MySQL Verification Team
Hi, Thank you for your bug report. We believe you that you experience performance problems on the restore of data. However, we must be able to repeat your problem in order to verify your report. Hence, please upload the entire dump file, either gzipped or zipped. Use tab "Files" for that operation. Data will be visible only to us, Oracle employees. Before proceeding to uploading the dump, please try mysqlpump program. It has a very similar set of options as mysqldump, but it is much faster, especially for InnoDB tables. So, please, inform us first of the speed differences that you get with mysqlpump program. Many thanks in advance.
[19 Dec 2018 15:14]
Florian Kopp
Thanks for reply. Indeed importing a dump created with mysqlpump can be restored much faster than created with mysqldump. But restoring the mysqlpump-file to the mysql 5.7 server is still round about 3 times faster than restoring on the mysql 8.0.13 server. Now, i uploaded the original simple SQL-file (manually created, not by mysqlpump), it shows the massive import performance difference between 5.7 and 8.0.13 best. Please let me know if you need more information about my configuration.
[19 Dec 2018 15:20]
MySQL Verification Team
Hi, What you experience, can be due to change in the data dictionary. Can you try dumping all databases, except `mysql` database. Then, with 5.7 and 8.0 first initialise the mysql database with --initialize option. There is one more item. How many tables do you have in total ??? I am asking this because 8.0 does not use FRM file. All metadata are stored in the InnoDB data dictionary, which is MUCH slower then simple FRM file. If you have many tables, then this is expected behaviour.
[19 Dec 2018 15:21]
MySQL Verification Team
One more item. I do not see your file, so where is it actually uploaded ????
[19 Dec 2018 16:20]
Florian Kopp
I uploaded the file via sftp as "mysql-bug-data-93684.zip" to /support/incoming/. The original database conatins about 370 tables. But the uploaded test dump has only 2 tables and restoring is very slow in mysql 8.0.13 too.
[19 Dec 2018 16:43]
MySQL Verification Team
Hi, One more notice. On 8.0 you need skip-log-bin in my.cnf to disable the binlog to be comparable to 5.7. else the sync_binlog=1 and single-row inserts will kill performance on non-write-cache disk.
[19 Dec 2018 16:49]
MySQL Verification Team
I must note that you made a big mistake by using single-row inserts ....... Those are so much slower then multi-row ones .......
[19 Dec 2018 16:52]
MySQL Verification Team
Hi, This is the output from the command `time` when used on feeding that SQLFILE into 5.7.24: real 0m30.456s user 0m1.860s sys 0m0.863s
[19 Dec 2018 17:01]
MySQL Verification Team
Hi, And these are the times when applying the same SQLFILE into 8.0.14: real 0m31.441s user 0m1.450s sys 0m0.622s As you can see , differences in the speed are minimal. So, you try all the recommendations that were given you in this bug report and your difference will be small too. There are many other ways to gap the difference, but those are beyond a bug report. Also, I have 2 Tb of SSD on my iMac, which I used for the databases and tables. If you have a slow disk, then this can be turned into a documentation bug.
[20 Jan 2019 1:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".
[5 Dec 2023 13:54]
MySQL Verification Team
Hi Mr. Kopo, We have some new measurements for you ..... We tried this with the latest 5.7.44-linux-glibc2.12-x86_64 package on the following OCI shape: Shape: VM.Standard.E3.Flex Shape Cfg: Ocpus: 4 - Mem: 4 GB running OL8. We get: [mysql-5.7.44-linux-glibc2.12-x86_64]$ time bin/mysql -u root -S mysqld.sock < x.sql real 0m20.024s user 0m0.005s sys 0m0.002s [mysql-8.0.35-linux-glibc2.12-x86_64]$ time bin/mysql -u root -S mysqld.sock < ../mysql-5.7.44-linux-glibc2.12-x86_64/x.sql real 0m25.753s user 0m0.003s sys 0m0.005s Using the following config on both: [mysqld] innodb_buffer_pool_size = 2048M innodb_log_buffer_size = 64M innodb_log_file_size = 265M innodb_flush_log_at_trx_commit=2 innodb_flush_method=O_DIRECT max_allowed_packet = 512G If I disable binlog by adding (as suggested) "skip-bin-log" to 8.0's my.cnf we get: [mysql-8.0.35-linux-glibc2.12-x86_64]$ bin/mysql -u root -S mysqld.sock -e "select @@log_bin" +-----------+ | @@log_bin | +-----------+ | 0 | +-----------+ [mysql-8.0.35-linux-glibc2.12-x86_64]$ time bin/mysql -u root -S mysqld.sock < ../mysql-5.7.44-linux-glibc2.12-x86_64/x.sql real 0m15.564s user 0m0.006s sys 0m0.003s So, by our measurements, 8.0.35 is faster than 5.7.44 by about 5 secs (about 30%) in OCI. Not a bug.