当前位置:网站首页>MySQL's InnoDB thread model
MySQL's InnoDB thread model
2022-08-05 12:00:00 【ziye cotyledons】

IO Thread
InnoDB uses a lot of AIO (Async IO Asynchronous IO) for read and write processing, which can greatly improve the capacity of the database.Before InnoDB 1.0, there were 4 IO threads, namely write, read, insert buffer, and log thread. Later versions increased the number of read threads and write threads to 4, for a total of 10 threads.- View command: show engine innodb status;

- read thread: Responsible for reading operations, loading data from disk to page.4
- write thread : Responsible for write operations, flushing cached dirty pages to disk.4
- log thread : Responsible for flushing log buffer contents to disk.1
- insert buffer thread: Responsible for flushing the write buffer content to disk.1
- View command: show engine innodb status;
Purge Thread
After the transaction is committed, the undo log used by it is no longer needed, and the Purge Thread is responsible for recycling the allocated undo pages.- View command: show variables like '%innodb_purge_threads%';

- Default Value = 4 means there are 4 threads responsible for recycling undo pages
- View command: show variables like '%innodb_purge_threads%';
Page Claner Thread
The function is to flush the dirty data to the disk. After the dirty data is flushed to the disk, the corresponding redo log can be overwritten, that is, the data can be synchronized, and theThe purpose of redo log recycling.Will call write thread thread processing.- View command: show variables like '%innodb_page_cleaners%';

- Default Value = 1 means 1 thread
- View command: show variables like '%innodb_page_cleaners%';
Master Thread
The master thread is the main thread of InnoDB and is responsible for scheduling other threads with the highest priority.The function is to asynchronously flush the data in the buffer pool to the disk to ensure data consistency.Including: flushing dirty pages (calling page chener thread), undo page recycling (scheduling purge thread), redo log log flushing (calling log thread), combined write buffering (that is, the data in the buffer and the data just queried from the disk)data are merged), etc.There are two main processing inside, one is processing every 1 second and every 10 secondsOperations every 1 second:
- flush log buffer to disk
- Merge the write buffer data and decide whether to operate according to the IO read and write pressure
- Refresh dirty page data to disk, and operate only when the proportion of dirty pages reaches 75% (the default value is 75%)
- View command: show variables like '%innodb_max_dirty_pages_pct%';

- innodb_max_dirty_pages_pct_lwm indicates that when the proportion of dirty pages in the Buffer Pool is lower than this value, the dirty page pre-flush function can be triggered to gradually control the proportion of dirty pages.The default is 0, which means off
- The default refresh is 200 pages each time, and the maximum number cannot exceed 2000 pages
- View command: show variables like '%innodb_io_capacity%'

- View command: show variables like '%innodb_max_dirty_pages_pct%';
Operations every 10 seconds:
- Flush dirty page data to disk
- Merge write buffer data
- Flush log buffer data
- Delete useless undo pages
- Delete 300 each time by default
- View command: show variables like '%innodb_purge_batch_size%'

Other chapters ->Jump
end...边栏推荐
- PMP每日一练 | 考试不迷路-8.5(包含敏捷+多选)
- 训练集Loss收敛,但是测试集Loss震荡的厉害?
- 食品饮料行业B2B商城系统:加速行业数字化转型,提升B2B平台交易效率
- hdu1455 Sticks (search+pruning+pruning+.....+pruning)
- Go Quick Start Guide: Basic Types
- 2-2.基金的投资交易与结算
- Byte Qiu Zhao confused me on both sides, and asked me under what circumstances would the SYN message be discarded?
- Monthly observation of Internet medical field in June 2022
- Three.js 点击模型,高亮发光模型外轮廓
- Shang Silicon Valley-JVM-Memory and Garbage Collection (P1~P203)
猜你喜欢

莅临GOPS大会龙智展位,获取Forrester最新报告:《Forrester Wave:2021年第四季度企业服务管理报告》

Go compilation principle series 9 (function inlining)

2022年6月互联网医疗领域月度观察
The importance of parameter naming, remember a JDBC parameter conflict

没开发人员,接到开发物联网系统的活儿,干不干?

C language classic examples - find the largest number in a series of numbers

详细剖析 Redis 三种集群策略

学习用于视觉跟踪的深度紧凑图像表示

sentinel介绍和使用

KVM virtualization technology-NUMA technology and application
随机推荐
Face the summary - club resort - 6 years
163_技巧_Power BI 一键批量建立自定义字段参数
623. 在二叉树中增加一行 : 简单二叉树遍历运用题
The principle and application scenario of mysql master-slave synchronization
《Grandmaster level in StarCraft II using multi-agent reinforcement learning》翻译
2022年6月互联网医疗领域月度观察
消息中间件汇总
Go compilation principle series 9 (function inlining)
Digital-intelligent supply chain system in the household appliance industry: efficiently integrate the supply chain and enhance the core competitiveness of household appliance enterprises
Shang Silicon Valley-JVM-Memory and Garbage Collection (P1~P203)
该不该将单体架构迁移到微服务?
【Untitled】
Byte Qiu Zhao confused me on both sides, and asked me under what circumstances would the SYN message be discarded?
训练集Loss收敛,但是测试集Loss震荡的厉害?
高泽龙出席博鳌全球旅游生态大会 讲元宇宙与未来网络科技
一:OpenCV图片读取与写入文件帮助文档
Object中的方法
Small household appliance industry supply chain collaborative management system: help enterprises break through market competition and strengthen the rapid response capability of the supply chain
2022.08.02_Daily question
Three.js 点击模型,高亮发光模型外轮廓