当前位置:网站首页>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
边栏推荐
- 2022 Xinjiang's latest eight members (Safety Officer) simulated examination questions and answers
- Analysis of tars source code 5
- Download kicad on Alibaba cloud image station
- 期末周,我裂开
- regular expression
- Background and current situation of domestic CDN acceleration
- Fundamentals of SQL database operation
- GoogleChromePortable 谷歌chrome浏览器便携版官网下载方式
- Mysql 45讲学习笔记(七)行锁
- Another company raised the price of SAIC Roewe new energy products from March 1
猜你喜欢
The solution of win11 taskbar right click without Task Manager - add win11 taskbar right click function
Tree DP
uniapp 自定義環境變量
[problem record] 03 connect to MySQL database prompt: 1040 too many connections
Matlab remainder
Shopping malls, storerooms, flat display, user-defined maps can also be played like this!
How to avoid JVM memory leakage?
Another company raised the price of SAIC Roewe new energy products from March 1
GoogleChromePortable 谷歌chrome浏览器便携版官网下载方式
How to use multithreading to export excel under massive data? Source code attached!
随机推荐
Background and current situation of domestic CDN acceleration
What is the "relative dilemma" in cognitive fallacy?
Analysis of tars source code 1
期末周,我裂开
regular expression
2022 wechat enterprise mailbox login entry introduction, how to open and register enterprise wechat enterprise mailbox?
[untitled]
Common JS tool Libraries
P26-P34 third_ template
2022, peut - être la meilleure année économique de la prochaine décennie, avez - vous obtenu votre diplôme en 2022? Comment est - ce prévu après la remise des diplômes?
ADC voltage calculation of STM32 single chip microcomputer
JSON web token -- comparison between JWT and traditional session login authentication
[March 3, 2019] MAC starts redis
ABCD four sequential execution methods, extended application
7. Agency mode
2022.7.3-----leetcode. five hundred and fifty-six
Considerations for testing a website
centos8安装mysql.7 无法开机启动
tars源码分析之8
Tar source code analysis Part 2