In this blog post, we’ll be discussing Percona Server 5.7 performance improvements.
Starting from the Percona Server 5.6 release, we’ve introduced several significant changes that help address performance problems for highly-concurrent I/O-bound workloads. Some of our research and improvements were re-implemented for MySQL 5.7 – one of the best MySQL releases. But even though MySQL 5.7 showed progress in various aspects of scalability and performance, we’ve found that it’s possible to push I/O bound workload limits even further.
Percona Server 5.7.11 currently has two major performance features in this area:
Now let’s review the results of a sysbench OLTP_RW, I/O-bound scenario. Below are the key settings that we used in our test:
While evaluating MySQL 5.7 RC we observed a performance drop in I/O-bound workloads, and it looked very similar to MySQL 5.6 behavior. The reason for the drop is the lack of free pages in the buffer pool. Page cleaner threads are unable to perform enough LRU flushing to keep up with the demand, and the query threads resort to performing single page flushes. This results in increased contention between all the of the flushing structures (especially the doublewrite buffer).
For ages (Vadim discussed this ten years ago!) InnoDB has had a universal workaround for most scalability issues: the innodb_thread_concurrency system variable. It allows you to limit the number of active threads within InnoDB and reduce shared resource contention. However, it comes with a trade-off in that the maximum possible performance is also limited.
To understand the effect, we ran the test two times with two different InnoDB concurrency settings:
To understand the details better, let’s zoom into the test run with 512 threads:
The charts above show that contentions significantly affect unrestricted concurrency throughput, but affect latency even worse. Limiting concurrency helps to address contentions, but even with this setting Percona Server shows 15-25% better.
Below you can see the contention situation for each of the above runs. The graphs show total accumulated waiting time across all threads per synchronization object (per second). For example, the absolute hottest object across all graphs is the doublewrite mutex in MySQL-5.7.11 (without thread concurrency limitation). It has about 17 seconds of wait time across 512 client threads for each second of run time.
mysql server settings
|
1 |
innodb_log_file_size=10G<br>innodb_doublewrite=1<br>innodb_flush_log_at_trx_commit=1<br>innodb_buffer_pool_instances=8<br>innodb_change_buffering=none<br>innodb_adaptive_hash_index=OFF<br>innodb_flush_method=O_DIRECT<br>innodb_flush_neighbors=0<br>innodb_read_io_threads=8<br>innodb_write_io_threads=8<br>innodb_lru_scan_depth=8192<br>innodb_io_capacity=15000<br>innodb_io_capacity_max=25000<br>loose-innodb-page-cleaners=4<br>table_open_cache_instances=64<br>table_open_cache=5000<br>loose-innodb-log_checksum-algorithm=crc32<br>loose-innodb-checksum-algorithm=strict_crc32<br>max_connections=50000<br>skip_name_resolve=ON<br>loose-performance_schema=ON<br>loose-performance-schema-instrument='wait/synch/%=ON',<br> |
If you are already testing 5.7, consider giving Percona Server a spin – especially if your workload is I/O bound. We’ve worked hard on Percona Server 5.7 performance improvements. In upcoming posts, we will delve into the technical details of our LRU flushing and doublewrite buffer changes.
Resources
RELATED POSTS