我们最近在数据库服务器上从Percona 5.6.19升级到5.6.28。相比之下,与5.6.19相比,5.6.28上的磁盘写入iops更加苛刻。
我在生产环境中检查了两个版本中的所有参数,除了路径和Percona 5.6.28中引入的一些较新变量之外,它们几乎相似,但它们似乎都与我们看到的问题无关。
我在服务器与5.6.19和5.6.28之间附加了变量差异。
这两个服务器都是分片的,所以它们两者的负载非常相似,而且它们都是当前的主服务器。
从我所看到的情况来看,缓冲池脏页似乎在5.6.28中比5.6.19更频繁地刷新,这就是为什么我相信我们看到了峰值。
附上您将找到缓冲池脏页的对比图,为期4小时。
Buffer pool dirty pages-bytes 5.6.19 Buffer pool dirty pages-bytes 5.6.19
以下是两台服务器上设置的参数: Percona 5.6.28
root@P5628 [(none)]> show global variables like 'version';
+---------------+-----------------+
| Variable_name | Value |
+---------------+-----------------+
| version | 5.6.28-76.1-log |
+---------------+-----------------+
1 row in set (0.00 sec)
root@P5628 [(none)]> show global variables like '%buffer%';
+-------------------------------------+----------------+
| Variable_name | Value |
+-------------------------------------+----------------+
| bulk_insert_buffer_size | 8388608 |
| innodb_buffer_pool_dump_at_shutdown | ON |
| innodb_buffer_pool_dump_now | OFF |
| innodb_buffer_pool_filename | ib_buffer_pool |
| innodb_buffer_pool_instances | 8 |
| innodb_buffer_pool_load_abort | OFF |
| innodb_buffer_pool_load_at_startup | ON |
| innodb_buffer_pool_load_now | OFF |
| innodb_buffer_pool_populate | OFF |
| innodb_buffer_pool_size | 47244640256 |
| innodb_change_buffer_max_size | 25 |
| innodb_change_buffering | all |
| innodb_log_buffer_size | 33554432 |
| innodb_sort_buffer_size | 1048576 |
| join_buffer_size | 262144 |
| key_buffer_size | 67108864 |
| myisam_sort_buffer_size | 134217728 |
| net_buffer_length | 16384 |
| preload_buffer_size | 32768 |
| read_buffer_size | 131072 |
| read_rnd_buffer_size | 262144 |
| sort_buffer_size | 262144 |
| sql_buffer_result | OFF |
+-------------------------------------+----------------+
23 rows in set (0.00 sec)
root@P5628 [(none)]> show global variables like '%dirty%';
+--------------------------------+-------+
| Variable_name | Value |
+--------------------------------+-------+
| innodb_max_dirty_pages_pct | 75 |
| innodb_max_dirty_pages_pct_lwm | 0 |
+--------------------------------+-------+
2 rows in set (0.00 sec)
root@P5628 [(none)]> show global variables like '%flush%';
+-------------------------------------------+---------------------+
| Variable_name | Value |
+-------------------------------------------+---------------------+
| binlog_max_flush_queue_time | 0 |
| flush | OFF |
| flush_time | 0 |
| innodb_adaptive_flushing | ON |
| innodb_adaptive_flushing_lwm | 10 |
| innodb_flush_log_at_timeout | 1 |
| innodb_flush_log_at_trx_commit | 2 |
| innodb_flush_method | O_DIRECT |
| innodb_flush_neighbors | 0 |
| innodb_flushing_avg_loops | 30 |
| innodb_foreground_preflush | exponential_backoff |
| innodb_use_global_flush_log_at_trx_commit | ON |
+-------------------------------------------+---------------------+
12 rows in set (0.00 sec)
Percoan 5.6.19
root@P5619 [(none)]> show global variables like 'version';
+---------------+-----------------+
| Variable_name | Value |
+---------------+-----------------+
| version | 5.6.19-67.0-log |
+---------------+-----------------+
1 row in set (0.00 sec)
root@P5619 [(none)]> show global variables like '%buffer%';
+-------------------------------------+----------------+
| Variable_name | Value |
+-------------------------------------+----------------+
| bulk_insert_buffer_size | 8388608 |
| innodb_buffer_pool_dump_at_shutdown | ON |
| innodb_buffer_pool_dump_now | OFF |
| innodb_buffer_pool_filename | ib_buffer_pool |
| innodb_buffer_pool_instances | 8 |
| innodb_buffer_pool_load_abort | OFF |
| innodb_buffer_pool_load_at_startup | ON |
| innodb_buffer_pool_load_now | OFF |
| innodb_buffer_pool_populate | OFF |
| innodb_buffer_pool_size | 47244640256 |
| innodb_change_buffer_max_size | 25 |
| innodb_change_buffering | all |
| innodb_log_buffer_size | 33554432 |
| innodb_sort_buffer_size | 1048576 |
| join_buffer_size | 262144 |
| key_buffer_size | 67108864 |
| myisam_sort_buffer_size | 134217728 |
| net_buffer_length | 16384 |
| preload_buffer_size | 32768 |
| read_buffer_size | 131072 |
| read_rnd_buffer_size | 262144 |
| sort_buffer_size | 262144 |
| sql_buffer_result | OFF |
+-------------------------------------+----------------+
23 rows in set (0.00 sec)
root@P5619 [(none)]> show global variables like '%dirty%';
+--------------------------------+-------+
| Variable_name | Value |
+--------------------------------+-------+
| innodb_max_dirty_pages_pct | 75 |
| innodb_max_dirty_pages_pct_lwm | 0 |
+--------------------------------+-------+
2 rows in set (0.00 sec)
root@P5619 [(none)]> show global variables like '%flush%';
+-------------------------------------------+---------------------+
| Variable_name | Value |
+-------------------------------------------+---------------------+
| audit_json_file_flush | OFF |
| binlog_max_flush_queue_time | 0 |
| flush | OFF |
| flush_time | 0 |
| innodb_adaptive_flushing | ON |
| innodb_adaptive_flushing_lwm | 10 |
| innodb_flush_log_at_timeout | 1 |
| innodb_flush_log_at_trx_commit | 2 |
| innodb_flush_method | O_DIRECT |
| innodb_flush_neighbors | 0 |
| innodb_flushing_avg_loops | 30 |
| innodb_foreground_preflush | exponential_backoff |
| innodb_use_global_flush_log_at_trx_commit | ON |
+-------------------------------------------+---------------------+
13 rows in set (0.00 sec)
如果您有任何人遇到类似问题,请告知我们,原因可能是什么。
非常感谢任何帮助。
谢谢!