当前位置:网站首页>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 .
边栏推荐
- 2021.11.10汇编考试
- 2021.11.10 compilation examination
- Unity3D摄像机,键盘控制前后左右上下移动,鼠标控制旋转、放缩
- VSCode基础配置
- (五)R语言入门生物信息学——ORF和序列分析
- Arduino get random number
- Pytorch: tensor operation (I) contiguous
- (4) Data visualization of R language -- matrix chart, histogram, pie chart, scatter chart, linear regression and strip chart
- [leetcode19] delete the penultimate node in the linked list
- 编译原理:源程序的预处理及词法分析程序的设计与实现(含代码)
猜你喜欢
NRF24L01故障排查
JS function promotion and declaration promotion of VaR variable
ES6 grammar summary -- Part 2 (advanced part es6~es11)
Unity场景跳转及退出
JS變量類型以及常用類型轉換
[Clickhouse kernel principle graphic explanation] about the collaborative work of partitioning, indexing, marking and compressed data
Page performance optimization of video scene
Naive Bayesian theory derivation
Unity3d makes the registration login interface and realizes the scene jump
dosbox第一次使用
随机推荐
2021.11.10 compilation examination
Redis cache update strategy, cache penetration, avalanche, breakdown problems
First use of dosbox
Latex learning
[Red Treasure Book Notes simplified version] Chapter 12 BOM
[Clickhouse kernel principle graphic explanation] about the collaborative work of partitioning, indexing, marking and compressed data
Arduino gets the length of the array
记一次云服务器被密码爆破的经历——关小黑屋、改密码、改端口
RuntimeError: cuDNN error: CUDNN_ STATUS_ NOT_ INITIALIZED
[Offer29] 排序的循环链表
[leetcode622]设计循环队列
Talking about the startup of Oracle Database
(1) Introduction Guide to R language - the first step of data analysis
Learning notes of JS variable scope and function
Remember an experience of ECS being blown up by passwords - closing a small black house, changing passwords, and changing ports
Who says that PT online schema change does not lock the table, or deadlock
The dolphin scheduler remotely executes shell scripts through the expect command
[offer18] delete the node of the linked list
Arduino get random number
Get the position of the nth occurrence of the string