Where the open source database community meets: Use code PERCONA75 and secure your spot for Percona Live.  Register

MySQL 8 is not always faster than MySQL 5.7

February 21, 2019
Author
Vadim Tkachenko
Share this Post:

MySQL 8.0.15 performs worse in sysbench oltp_read_write than MySQL 5.7.25

Initially I was testing group replication performance and was puzzled why MySQL 8.0.15 performs consistently worse than MySQL 5.7.25.

It appears that a single server instance is affected by a performance degradation.

My testing setup

mysql 8 slower than mysql 5.7 sysbenchHardware details:
Bare metal server provided by packet.net, instance size: c2.medium.x86
24 Physical Cores @ 2.2 GHz
(1 X AMD EPYC 7401P)
Memory: 64 GB of ECC RAM

Storage : INTEL® SSD DC S4500, 480GB

This is a server grade SATA SSD.

Benchmark

In the following summary I used these combinations:

    • innodb_flush_log_at_trx_commit=0 or 1
    • Binlog: off or on
    • sync_binlog=1000 or sync_binlog=1

The summary table, the number are transactions per second (tps – the more the better)

Summary: MySQL 8.0.15 is persistently worse than MySQL 5.7.25.

In the worst case with trx_commit=0 and sync_binlog=1000 , it is worse by 22%, which is huge.

I was looking to use these settings for group replication testing, but these settings, when used with MySQL 8.0.15, provide much worse results than I had with MySQL 5.7.25

(*) in the case of trx_commit=0, binlog=off, MySQL 5.7.25 performance is very stable, and practically stays at the 11400 tps level. MySQL 8.0.15 varies a lot from 8758 tps to 10299 tps in 1 second resolution measurements

Update:

To clarify some comments, I’ve used latin1 CHARSET in this benchmark for both MySQL 5.7 and MySQL 8.0

Appendix:


Photo by Suzy Hazelwood from Pexels

0 0 votes
Article Rating
Subscribe
Notify of
guest

17 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Andy
Andy
7 years ago

I’ve seen many benchmarks that show MySQL 8.0 faster than 5.7. For example this: https://severalnines.com/blog/mysql-performance-benchmarking-mysql-57-vs-mysql-80

And this: http://dimitrik.free.fr/blog/posts/mysql-performance-80-iobound-oltprw-vs-percona57.html

Are there any rules of thumb about the conditions under which MySQL 8.0 is generally faster? Something like MySQL 8.0 is faster for read only workload but 5.7 is faster for read-write?

Andy
Andy
7 years ago
Reply to  vadimtk

Vadim,

That’s interesting. Do you recommend upgrading to MySQL 8.0 then?

Morgan Tocker (@morgo)
Reply to  vadimtk

I agree sysbench is often not realistic, but I think there is a case where MySQL 8.0 is a lot faster and matches real-world use cases: utf8mb4.

It was not really a priority in earlier releases, but most users are using utf8mb4.

Pavel Katiushyn
Pavel Katiushyn
7 years ago
Reply to  Andy

For mid and low loaded databases 5.5 is faster than 5.6, 5.6 better than 5.7. So no surprise here as well. I suppose this is the price for reacher functionality, that we get with every new version.

james wang
james wang
7 years ago

There is no free lunch as it says 🙂

Jason Perrone
7 years ago
Reply to  vadimtk

I noticed almost instantly that 8 is slower than 5.7. Disturbingly so. I was wondering if maybe I needed some new settings in my.cnf that I didn’t know about.

Peter Zaitsev
Admin
7 years ago

Vadim,

Morgan brings an important question. I do not see character set configured in your my.cnf file. Are the servers using same character set for communication and table data ?

Geir Høydalsvik
7 years ago

Vadim, Do you have thoughts on “what is a realistic workload?”. For example, is SysBench considered a realistic workload, DBT3, …? And is latin1 more realistic than utf8mb4, or is it the other way around ?

Michael D.
Michael D.
7 years ago
Reply to  vadimtk

my “realistic” rule of thumb is for app in dev. process use/switch to latest version.
Supporting factors:
1. Better for long run
2. as @vadimtk said “I do not believe such thing as “realistic workload” exists…”

Peter Zaitsev
Admin
7 years ago

Geir, In my opinion for modern applications it is utf8 what matters so MySQL 8 being faster with this charset is great! However if we only get utf8 handling in MySQL 8 much faster but everything else got slower it is not a great trend.

Fixer
Fixer
7 years ago

There’s a lot to digest here without a whole lot of information; however, I really think you need to modify most of your configuration options.

Remove the deprecated entry

Fix your log size (run the test to see what it should be)
https://www.percona.com/blog/2017/10/18/chose-mysql-innodb_log_file_size/

Increase join_buffer_size, it’s set to the minimum.

Fix innodb_file_per_table=1

Fix the spacings with = and value (they should be set without the weird arrangement of spaces)

etc… once fixed and optimized for your actual session needs, memory & cache, it should really chug along well.

Wayne
Wayne
6 years ago

mysql 8 is much slower than 5.7 for ‘create table’ and ‘create procedure’. The disk activity on my Windows 10 keeps 100% for a long time.

Ilya S
Ilya S
6 years ago

Confirming this issue. I had 100 GB DB (~200GB including indexes). Updated it from 5.7 to 8. My DB is used by a few people only, and almost 24/7 there running some heavy calculation scripts. Overall performance slowed down notably. Updated all my utf8 columns to utf8mb4. When disabled binlog the performance restored to the level of 5.7 with enabled binlog. Going to try Percona Server to see if it gives any better performance.

Far
Enough.

Said no pioneer ever.
MySQL, PostgreSQL, InnoDB, MariaDB, MongoDB and Kubernetes are trademarks for their respective owners.
© 2026 Percona All Rights Reserved