当前位置:网站首页>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
边栏推荐
- Modify TCP timestamp to optimize transmission performance
- Summary of leetcode BFS question brushing
- InputStream/OutputStream(文件的输入输出)
- 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
- Manually page the list (parameter list, current page, page size)
- 7. Agency mode
- 颈椎、脚气
- Download kicad on Alibaba cloud image station
- Inputstream/outputstream (input and output of file)
- C语言中的排序,实现从小到大的数字排序法
猜你喜欢
uniapp 自定义环境变量
Wechat applet scroll view component scrollable view area
How to use multithreading to export excel under massive data? Source code attached!
双色球案例
leetcode 310. Minimum Height Trees
what the fuck! If you can't grab it, write it yourself. Use code to realize a Bing Dwen Dwen. It's so beautiful ~!
Appium基础 — APPium安装(二)
How to choose the middle-aged crisis of the testing post? Stick to it or find another way out? See below
Fundamentals of SQL database operation
P26-P34 third_ template
随机推荐
2022年,或许是未来10年经济最好的一年,2022年你毕业了吗?毕业后是怎么计划的?
Practical gadget instructions
MySQL learning notes 3 - JDBC
【MySQL】数据库视图的介绍、作用、创建、查看、删除和修改(附练习题)
7. Agency mode
Appium foundation - appium installation (II)
微信小程序使用rich-text中图片宽度超出问题
Common usage of time library
STM32 单片机ADC 电压计算
对List进行排序工具类,可以对字符串排序
[problem record] 03 connect to MySQL database prompt: 1040 too many connections
颈椎、脚气
Data analysis notes 09
双色球案例
2022 is probably the best year for the economy in the next 10 years. Did you graduate in 2022? What is the plan after graduation?
Mysql 45讲学习笔记(七)行锁
Analysis of tars source code 5
手动对list进行分页(参数list ,当前页,页面大小)
tars源码分析之3
Cloud native - SSH article that must be read on the cloud (commonly used for remote login to ECS)