while performing performance tests of our system in preparation for an upgrade to Percona MySQL 8.0 we have noticed that IO load increased by about two times and almost up to 100% utilization.
so after concluding series of tests, which include a very short transaction performing one of insert operations used by our system and executed with the same fixed TPS per thread (16) and with the same number of threads (128) plus a periodical cleanup of records inserted earlier, we have discovered that a lot more of writes to redo logs and log fsyncs are performed in comparation with MySQL 5.7:
there are in avg 48.91k (max 71.3k) of log write operations and in avg 25.43MB/s (max 36.85MB/s) on Percona MySQL 8.0.22 vs 1.71k (1.87k) and 5.98MB/s (8.55MB/s) on Percona MySQL 5.7.20.
it appears that the new log writer threads, which are enabled by default, are responsible for it and after turning it off via the new option âinnodb_log_writer_threadsâ, the number of redo log write operations and amount of log data have been returned to values close to ones on MySQL 5.7.
However, an average elapsed time per transaction is greatly increased: from 0.505ms on MySQL 8.0.22 with log writer threads (and 0.485ms on MySQL 5.7) up to 2.120ms on MySQL 8.0.22 without log writer threads and most of time (~1.68ms) have been spent during commits.
the only changed metrics are ones related to row locks: an average number of threads waiting on row locks, which is most likely a consequence of an increased transaction time, and a number of innodb contentions: there are about three times more of OS wait operations and Spin waits.
the both situations, i.e. a soaring spike of redo log related operations caused by redo log writer threads and an increased transaction time without it, look like serious degradations and probably caused by some bugs.
any ideas how to relieve such situation?
is it the expected behavior or should I file a formal bug report for it?
there is a screenshot of PMM graphs showing redo log IOs during the test runs and contentions: a time interval from 14:20 until 14:40 corresponds MySQL 5.7, from 15:35 to 15:55 - MySQL 8.0 with redo log writer threads turned on and from 16:40 to 17:00 - MySQL 8.0 with redo log writer threads turned off.
the same options are used for the both mysql 5.7 and 8.0:
[mysqld]
innodb_numa_interleave = ON
relay-log = relay-bin
relay_log_info_repository = TABLE
relay_log_recovery = ON
character-set-filesystem = utf8
default-time-zone = +00:00
log-bin-trust-function-creators = ON
explicit_defaults_for_timestamp = ON
max_allowed_packet = 16M
character_set_server = latin1
collation_server = latin1_swedish_ci
innodb_autoinc_lock_mode = 1
log_error_verbosity = 3
master_info_repository = FILE
default_authentication_plugin=mysql_native_password
max_connections = 500
log-bin = mysql-bin
binlog_format = ROW
userstat = OFF
thread_statistics = OFF
performance_schema = OFF
event_scheduler = ON
key_buffer_size = 64M
read_rnd_buffer_size = 8M
read_buffer_size = 2M
sort_buffer_size = 2M
max_heap_table_size = 128M
tmp_table_size = 128M
innodb_strict_mode = ON
innodb_stats_auto_recalc = ON
innodb_stats_persistent_sample_pages = 40
innodb_log_buffer_size = 8M
innodb_log_file_size = 100M
innodb_buffer_pool_size = 8192M
innodb_buffer_pool_instances = 8
innodb_buffer_pool_load_at_startup = ON
innodb_buffer_pool_dump_at_shutdown = ON
innodb_flush_method = O_DIRECT
innodb_flush_log_at_trx_commit = 1
innodb_flush_neighbors = 1
innodb_thread_concurrency = 0
innodb_commit_concurrency = 0
table_open_cache = 2000
table_open_cache_instances = 8
innodb_adaptive_hash_index = ON
innodb_io_capacity = 400
innodb_write_io_threads = 4
innodb_read_io_threads = 4
innodb_purge_threads = 2
innodb_print_all_deadlocks = ON
audit log configuration
plugin-load = audit_log=audit_log.so
audit_log_strategy = ASYNCHRONOUS
audit_log_file = audit.log
audit_log_format = NEW
audit_log_policy = QUERIES
audit_log_rotate_on_size = 1073741824
audit_log_rotations = 10
audit_log_handler = FILE
sync_binlog = 0
PMM
performance_schema=ON
performance-schema-instrument=âstatement/%=ONâ
performance-schema-consumer-statements-digest=ON
innodb_monitor_enable=all