当前位置:网站首页>MySQL performance tuning - dirty page refresh
MySQL performance tuning - dirty page refresh
2022-07-06 12:35:00 【wx5caecf2ed0645】
principle
When the contents of memory data page and disk data page are inconsistent , We call this memory page “ Dirty page ”. After memory data is written to disk , The contents of data pages on memory and disk are the same , be called “ Clean pages ”.
When the data page to be read is not in memory , You have to apply for a data page in the buffer pool . At this time, only the longest unused data page can be eliminated from memory : If it's a clean page to be eliminated , Just release it and reuse it ; But if it's a dirty page , You have to brush the dirty pages to disk first , It can only be reused after it becomes a clean page .
So the following two cases , It will obviously affect the performance :
- There are too many dirty pages to be eliminated in a query , The response time of the query will be significantly longer ;
- The log is full of , All updates are blocked , Writing performance has dropped to 0, For sensitive businesses , It is unacceptable .
therefore ,InnoDB There needs to be a mechanism to control the proportion of dirty pages , To try to avoid the above two situations .
Configuration tuning - innodb_io_capacity
innodb_io_capacity The default is 200, The unit is page , The setting size of this parameter depends on the size of the hard disk IOPS, That is, the input and output per second ( Or reading and writing times )
It will tell InnoDB Disk capabilities , So set this value to disk IOPS.
On disk IOPS Can pass fio This tool is used to test , The following statement is used to test the random read / write command of the disk :
fio -filename=$filename -direct=1 -iodepth 1 -thread -rw=randrw -ioengine=psync -bs=16k -size=500M -numjobs=10 -runtime=10 -group_reporting -name=mytest
- 1.
Configuration tuning - innodb_flush_neighbors
InnoDB The storage engine also provides Flush Neighbor Page( Refresh adjacent pages ) Characteristics of . Its working principle is : When a dirty page is refreshed ,InnoDB The storage engine detects the location of the page (extent) All pages of , If it's dirty , So let's refresh together .
InnoDB1.2.x The version starts with parameters innodb_flush_neighbors, Used to control whether the feature is enabled .
This feature is recommended for traditional mechanical hard drives , For solid-state drives, it has a high IOPS Performance disk , It is recommended that this parameter be set to 0, That is, turn off the feature .
边栏推荐
- (1) Introduction Guide to R language - the first step of data analysis
- [offer78] merge multiple ordered linked lists
- Easy to use shortcut keys in idea
- 基於Redis的分布式ID生成器
- JUC forkjoin and completable future
- Remember an experience of ECS being blown up by passwords - closing a small black house, changing passwords, and changing ports
- MySQL time, time zone, auto fill 0
- Intermediate use tutorial of postman [environment variables, test scripts, assertions, interface documents, etc.]
- First use of dosbox
- 燕山大学校园网自动登录问题解决方案
猜你喜欢
JS變量類型以及常用類型轉換
Fashion Gen: the general fashion dataset and challenge paper interpretation & dataset introduction
Arm pc=pc+8 is the most understandable explanation
Conditional probability
Redis cache update strategy, cache penetration, avalanche, breakdown problems
Walk into WPF's drawing Bing Dwen Dwen
Office提示您的许可证不是正版弹框解决
Esp8266 uses Arduino to connect Alibaba cloud Internet of things
[Red Treasure Book Notes simplified version] Chapter 12 BOM
Kconfig Kbuild
随机推荐
(5) Introduction to R language bioinformatics -- ORF and sequence analysis
Fashion Gen: the general fashion dataset and challenge paper interpretation & dataset introduction
Vulnhub target: hacknos_ PLAYER V1.1
单片机蓝牙无线烧录
Kconfig Kbuild
What is the maximum length of MySQL varchar field
About using @controller in gateway
ESP8266连接onenet(旧版MQTT方式)
(五)R语言入门生物信息学——ORF和序列分析
Arm pc=pc+8 is the most understandable explanation
[golang] leetcode intermediate - fill in the next right node pointer of each node & the k-smallest element in the binary search tree
Conditional probability
编译原理:源程序的预处理及词法分析程序的设计与实现(含代码)
open-mmlab labelImg mmdetection
Arduino gets the length of the array
HCIP Day 12
Pat 1097 duplication on a linked list (25 points)
[Offer29] 排序的循环链表
[leetcode622] design circular queue
Derivation of logistic regression theory