当前位置:网站首页>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
边栏推荐
- Appium foundation - appium installation (II)
- 双色球案例
- ABCD four sequential execution methods, extended application
- Arcpy uses the updatelayer function to change the symbol system of the layer
- Native Cloud - SSH articles must be read on Cloud (used for Remote Login to Cloud Server)
- After the festival, a large number of people change careers. Is it still time to be 30? Listen to the experience of the past people
- 内卷怎么破?
- tars源码分析之9
- uniapp 自定義環境變量
- Tar source code analysis Part 2
猜你喜欢

R statistical mapping - random forest classification analysis and species abundance difference test combination diagram

After the festival, a large number of people change careers. Is it still time to be 30? Listen to the experience of the past people

C language - Blue Bridge Cup - Snake filling

JSON web token -- comparison between JWT and traditional session login authentication

2022 wechat enterprise mailbox login entry introduction, how to open and register enterprise wechat enterprise mailbox?

24 magicaccessorimpl can access the debugging of all methods

如何实现视频平台会员多账号登录

Appium基础 — APPium安装(二)

Tree DP

Uniapp custom environment variables
随机推荐
GoogleChromePortable 谷歌chrome浏览器便携版官网下载方式
uniapp 自定义环境变量
[number theory] fast power (Euler power)
Tar source code analysis Part 2
746. Climb stairs with minimum cost
24 magicaccessorimpl can access the debugging of all methods
How to choose the middle-aged crisis of the testing post? Stick to it or find another way out? See below
thread priority
Operator < <> > fool test case
Arcpy 利用updatelayer函数改变图层的符号系统
[MySQL] introduction, function, creation, view, deletion and modification of database view (with exercises)
Wechat applet scroll view component scrollable view area
Mysql 45讲学习笔记(十三)表数据删掉一半,表文件大小不变
Code rant: from hard coding to configurable, rule engine, low code DSL complexity clock
2022.7.3-----leetcode. five hundred and fifty-six
7. Agency mode
【问题记录】03 连接MySQL数据库提示:1040 Too many connections
740. Delete and get points
STC8H开发(十二): I2C驱动AT24C08,AT24C32系列EEPROM存储
List of top ten professional skills required for data science work