当前位置:网站首页>MySQL 45 lecture learning notes (12) MySQL will "shake" for a while
MySQL 45 lecture learning notes (12) MySQL will "shake" for a while
2022-07-04 06:38:00 【Tom Kong】
One . scene
A modification SQL sentence , It's very fast in normal times , But sometimes it's very slow , The scene is difficult to reproduce , Short duration .
The reasons causing :
- InnoDB When processing update statements , Only do the disk operation of writing log . This log is called redo log( Redo log )
- After updating the memory redo log after , Return to the client , This update is successful
When the memory is full , When you have to synchronize to memory , It will be slower
flush Namely Data in memory is written to disk
- Dirty page : When memory data page and disk data page atypism When
- Clean pages : When memory And the data page on the disk The content is consistent
Two . Generate the scene of cleaning dirty pages
- redo log Full of , The system should stop all update operations , take checkpoint Push forward ,redo log Make room to continue writing .
- There is not enough memory in the system , A new memory page is required , Data pages need to be eliminated when memory is insufficient , Write dirty pages to disk
- MySQL Think of the system as “ Free ” When the
- MySQL Normally closed
Analysis of the first two situations :
- redo log It's full. , To brush flush Dirty page , This situation InnoDB Try to avoid , The system no longer accepts updates , All updates must be blocked
- There's not enough memory , Write dirty pages to disk , This situation is normal
InnoDB Use cache pool (buffer pool) Manage memory , Memory pages in the cache pool have three states :
- not used
- Used are all clean pages
- Used but dirty pages
InnoDB Try to use memory when implementing strategies , For a long-running Library , Not used There are few pages
Brush dirty pages yes Normal behavior , But the following will significantly affect performance :
- There are too many dirty pages to be eliminated , This leads to significantly longer query response time
- The log is full of , All updates are blocked , Writing performance has dropped to 0
3、 ... and .InnoDB Control strategy of brushing dirty pages
InnoDB Of the host IO Ability , such InnoDB To know when you need to brush dirty pages with all your strength , How fast can I brush .
innodb_io_capacity This parameter
- It is recommended to set the value to disk IOPS
- On disk IOPS It can be used fio Tool testing
边栏推荐
- tars源码分析之8
- 7. Agency mode
- What is the "relative dilemma" in cognitive fallacy?
- 云原生——上云必读之SSH篇(常用于远程登录云服务器)
- Lightroom import picture gray / Black rectangular multi display
- Realize IIC data / instruction interaction with micro batg135
- uniapp 自定義環境變量
- R统计绘图-随机森林分类分析及物种丰度差异检验组合图
- InputStream/OutputStream(文件的输入输出)
- Summary of leetcode BFS question brushing
猜你喜欢

198. House raiding

Which water in the environment needs water quality monitoring

C realize Snake games

R统计绘图-随机森林分类分析及物种丰度差异检验组合图

Learning multi-level structural information for small organ segmentation

校园网络问题

Arcpy 利用updatelayer函数改变图层的符号系统

Appium基础 — APPium安装(二)

ABAP:OOALV实现增删改查功能

Wechat applet scroll view component scrollable view area
随机推荐
what the fuck! If you can't grab it, write it yourself. Use code to realize a Bing Dwen Dwen. It's so beautiful ~!
2022年,或许是未来10年经济最好的一年,2022年你毕业了吗?毕业后是怎么计划的?
[Android reverse] function interception (CPU cache mechanism | CPU cache mechanism causes function interception failure)
SQL join, left join, right join usage
JSON web token -- comparison between JWT and traditional session login authentication
Download kicad on Alibaba cloud image station
Redis面试题集
Vant --- detailed explanation and use of list component in vant
Learn about the Internet of things protocol WiFi ZigBee Bluetooth, etc. --- WiFi and WiFi protocols start from WiFi. What do we need to know about WiFi protocol itself?
Data analysis notes 09
tars源码分析之9
《国民经济行业分类GB/T 4754—2017》官网下载地址
tars源码分析之8
C realize Snake games
2022 Xinjiang's latest eight members (Safety Officer) simulated examination questions and answers
Tar source code analysis 6
《ClickHouse原理解析与应用实践》读书笔记(4)
selenium驱动IE常见问题解决Message: Currently focused window has been closed.
How to help others effectively
tars源码分析之10