当前位置:网站首页>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
边栏推荐
- 4G wireless all network solar hydrological equipment power monitoring system bms110
- Mysql 45讲学习笔记(十四)count(*)
- ABAP:OOALV实现增删改查功能
- C语言中的排序,实现从小到大的数字排序法
- Can the out of sequence message complete TCP three handshakes
- Realize IIC data / instruction interaction with micro batg135
- 《ClickHouse原理解析与应用实践》读书笔记(4)
- 27-31. Dependency transitivity, principle
- Shopping malls, storerooms, flat display, user-defined maps can also be played like this!
- Uniapp custom environment variables
猜你喜欢
How to realize multi account login of video platform members
C實現貪吃蛇小遊戲
颈椎、脚气
Reading notes of Clickhouse principle analysis and Application Practice (4)
QT get random color value and set label background color code
selenium驱动IE常见问题解决Message: Currently focused window has been closed.
Appium基础 — APPium安装(二)
Arcpy uses the updatelayer function to change the symbol system of the layer
27-31. Dependency transitivity, principle
Native Cloud - SSH articles must be read on Cloud (used for Remote Login to Cloud Server)
随机推荐
【问题记录】03 连接MySQL数据库提示:1040 Too many connections
Bicolor case
Mysql 45讲学习笔记(六)全局锁
Tar source code analysis 9
Mysql 45讲学习笔记(十二)MySQL会“抖”一下
Manually page the list (parameter list, current page, page size)
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?
双色球案例
2022.7.2-----leetcode. eight hundred and seventy-one
Tar source code analysis 4
tars源码分析之5
Mysql 45讲学习笔记(十四)count(*)
C实现贪吃蛇小游戏
How to choose the middle-aged crisis of the testing post? Stick to it or find another way out? See below
CORS is not intended to protect API endpoints - nikofischer
Sleep quality today 78 points
[March 3, 2019] MAC starts redis
Mysql 45讲学习笔记(十)force index
The width of the picture in rich text used by wechat applet exceeds the problem
内卷怎么破?