当前位置:网站首页>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 .
边栏推荐
- Flink late data processing (3)
- How to add music playback function to Arduino project
- 编译原理:源程序的预处理及词法分析程序的设计与实现(含代码)
- Vulnhub target: hacknos_ PLAYER V1.1
- Unity场景跳转及退出
- Database course design: college educational administration management system (including code)
- [leetcode622] design circular queue
- dosbox第一次使用
- Vscode basic configuration
- (5) Introduction to R language bioinformatics -- ORF and sequence analysis
猜你喜欢

(5) Introduction to R language bioinformatics -- ORF and sequence analysis

MySQL time, time zone, auto fill 0

Derivation of logistic regression theory

MySQL takes up too much memory solution

SVN更新后不出现红色感叹号

JS Title: input array, exchange the largest with the first element, exchange the smallest with the last element, and output array.

C programming exercise

Office提示您的许可证不是正版弹框解决

程序设计大作业:教务管理系统(C语言)

Single chip Bluetooth wireless burning
随机推荐
Detailed explanation of truncate usage
Kconfig Kbuild
[leetcode19]删除链表中倒数第n个结点
数据库课程设计:高校教务管理系统(含代码)
VSCode基础配置
[Offer18]删除链表的节点
Solution to the problem of automatic login in Yanshan University Campus Network
SVN更新后不出现红色感叹号
Arduino gets the length of the array
About using @controller in gateway
Gateway fails to route according to the service name, and reports an error service unavailable, status=503
Page performance optimization of video scene
Important methods of array and string
Common DOS commands
[Leetcode15]三数之和
[Nodejs] 20. Koa2 onion ring model ----- code demonstration
1081 rational sum (20 points) points add up to total points
VIM command line notes
Arduino get random number
编译原理:源程序的预处理及词法分析程序的设计与实现(含代码)