当前位置:网站首页>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
边栏推荐
- Cloud native - SSH article that must be read on the cloud (commonly used for remote login to ECS)
- leetcode 310. Minimum Height Trees
- Which water in the environment needs water quality monitoring
- 24 magicaccessorimpl can access the debugging of all methods
- 17-18. Dependency scope and life cycle plug-ins
- ADC voltage calculation of STM32 single chip microcomputer
- Fundamentals of SQL database operation
- Explain in one sentence what social proof is
- 《国民经济行业分类GB/T 4754—2017》官网下载地址
- tars源码分析之8
猜你喜欢

List of top ten professional skills required for data science work

MySQL learning notes 3 - JDBC

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

MySQL installation and configuration
![[MySQL] introduction, function, creation, view, deletion and modification of database view (with exercises)](/img/03/2b37e63d0d482d5020b7421ac974cb.jpg)
[MySQL] introduction, function, creation, view, deletion and modification of database view (with exercises)

Common usage of time library

Tree DP

C language exercises (recursion)

ABAP:OOALV实现增删改查功能

Bicolor case
随机推荐
Native Cloud - SSH articles must be read on Cloud (used for Remote Login to Cloud Server)
tars源码分析之1
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?
How does the inner roll break?
Wechat applet scroll view component scrollable view area
Average two numbers
对List进行排序工具类,可以对字符串排序
SQL join, left join, right join usage
What is the sheji principle?
2022 wechat enterprise mailbox login entry introduction, how to open and register enterprise wechat enterprise mailbox?
校园网络问题
27-31. Dependency transitivity, principle
Is the insurance annuity product worth buying? Is there a hole?
Considerations for testing a website
ORICO ORICO outdoor power experience, lightweight and portable, the most convenient office charging station
《国民经济行业分类GB/T 4754—2017》官网下载地址
P26-P34 third_ template
regular expression
MySQL learning notes 3 - JDBC
Lightroom import picture gray / Black rectangular multi display