Innodb后台线程
1.maste thread
负责将缓冲池中的数据异步刷新到磁盘,保证数据的一致性。
2.IO Thread
负责IO请求的回调处理。
1.0版本之前有4个IO Thread,负责write、read、insert buffer和log IO Thread
1.0.x开始,read thread和write thread分别增加到4个,不再使用innodb_file_io_threads参数,而是使用innodb_read_io_threads和innodb_write_io_threads
mysql> show variables like 'innodb_version'\G
*************************** 1. row ***************************
Variable_name: innodb_version
Value: 5.6.25
1 row in set (0.00 sec) mysql> show variables like 'innodb_%io_threads'\G
*************************** 1. row ***************************
Variable_name: innodb_read_io_threads
Value: 4
*************************** 2. row ***************************
Variable_name: innodb_write_io_threads
Value: 4
2 rows in set (0.00 sec) mysql> show engine innodb status\G
*************************** 1. row ***************************
Type: InnoDB
Name:
Status:
=====================================
2015-12-20 21:53:50 7fcaccfe8700 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from the last 11 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 93 srv_active, 0 srv_shutdown, 26243 srv_idle
srv_master_thread log flush and writes: 26336
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 393
OS WAIT ARRAY INFO: signal count 347
Mutex spin waits 297, rounds 8910, OS waits 281
RW-shared spins 53, rounds 1590, OS waits 50
RW-excl spins 13, rounds 1860, OS waits 57
Spin rounds per wait: 30.00 mutex, 30.00 RW-shared, 143.08 RW-excl
------------
TRANSACTIONS
------------
Trx id counter 2545
Purge done for trx's n:o < 2540 undo n:o < 0 state: running but idle
History list length 22
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0, not started
MySQL thread id 5, OS thread handle 0x7fcaccfe8700, query id 491 localhost root init
show engine innodb status
--------
FILE I/O
--------
I/O thread 0 state: waiting for i/o request (insert buffer thread)
I/O thread 1 state: waiting for i/o request (log thread)
I/O thread 2 state: waiting for i/o request (read thread)
I/O thread 3 state: waiting for i/o request (read thread)
I/O thread 4 state: waiting for i/o request (read thread)
I/O thread 5 state: waiting for i/o request (read thread)
I/O thread 6 state: waiting for i/o request (write thread)
I/O thread 7 state: waiting for i/o request (write thread)
I/O thread 8 state: waiting for i/o request (write thread)
I/O thread 9 state: waiting for i/o request (write thread)
Pending normal aio reads: 0 [0, 0, 0, 0] , aio writes: 0 [0, 0, 0, 0] ,
ibuf aio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; buffer pool: 0
915 OS file reads, 1496 OS file writes, 1089 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s
-------------------------------------
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 0, seg size 2, 0 merges
merged operations:
insert 0, delete mark 0, delete 0
discarded operations:
insert 0, delete mark 0, delete 0
Hash table size 276671, node heap has 2 buffer(s)
0.00 hash searches/s, 0.00 non-hash searches/s
---
LOG
---
Log sequence number 369664448
Log flushed up to 369664448
Pages flushed up to 369664448
Last checkpoint at 369664448
0 pending log writes, 0 pending chkp writes
356 log i/o's done, 0.00 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 137363456; in additional pool allocated 0
Dictionary memory allocated 96365
Buffer pool size 8191
Free buffers 53
Database pages 8136
Old database pages 2983
Modified db pages 0
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 9747, not young 4864716
0.00 youngs/s, 0.00 non-youngs/s
Pages read 4212, created 12449, written 13322
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
No buffer pool page gets since the last printout
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 8136, unzip_LRU len: 0
I/O sum[0]:cur[0], unzip sum[0]:cur[0]
--------------
ROW OPERATIONS
--------------
0 queries inside InnoDB, 0 queries in queue
0 read views open inside InnoDB
Main thread process no. 2345, id 140508950664960, state: sleeping
Number of rows inserted 3919015, updated 0, deleted 0, read 8532141
0.00 inserts/s, 0.00 updates/s, 0.00 deletes/s, 0.00 reads/s
----------------------------
END OF INNODB MONITOR OUTPUT
============================ 1 row in set (0.00 sec) mysql>
3.purge thread
事务提交后,purge thread线程回收已经分配并被使用的undo页。
innodb 1.2开始,支持多个purge thread。
purge thread离散地读取undo页。
mysql> show variables like 'innodb_purge_threads';
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| innodb_purge_threads | 1 |
+----------------------+-------+
1 row in set (0.00 sec) mysql>
4.page cleaner thread
1.2.x版本中引入的。将之前版本中脏页的刷新操作都放入到单独的线程中来完成。减轻master thread的工作。
Innodb后台线程的更多相关文章
- InnoDB体系架构(一)后台线程
InnoDB体系架构——后台线程 上一篇已经了解了MySQL数据库的体系结构 这一篇除了介绍InnoDB存储引擎的体系架构外,同时进一步了解InnoDB的后台线程. InnoDB存储引擎是多线程的模型 ...
- InnoDB的后台线程(IO线程,master线程,锁监控线程,错误监控线程)和内存(缓冲池,重做日志缓冲池,额外内存池)
InnoDB有多个内存块,你可以认为这些内存块组成了一个大的内存池,负责如下工作: 维护所有进程/线程需要访问的多个内部数据结构. 缓存磁盘上的数据,方便快速地读取,并且在对磁盘文件的数据进行修改之前 ...
- 14.6.8 Configuring the InnoDB Master Thread IO Rate 配置InnoDB 主线程IO 速率:
14.6.8 Configuring the InnoDB Master Thread IO Rate 配置InnoDB 主线程IO 速率: 主线程 在InnoDB 是一个线程 执行各种任务在后台. ...
- MySQL后台线程的清理工作
后台清理工作:脏页刷盘.undo回收 1.page cleaner thread:刷新脏页 2.purge thread:清空undo页.清理“deleted”page 一.innodb_page_c ...
- MySQL后台线程整理总结
本文整理自<MySQL技术内幕 InnoDB存储引擎> MySQL通过后台各种线程.内存池.文件交互来实现对外服务的,不同线程实现不同的资源操作,各个线程相互协助,共同来完成数据库的服务. ...
- MySQL学习笔记-数据库后台线程
数据库后台线程 默认情况下讲述的InnoDB存储引擎,以后不再重复声明.后台线程有7个--4个IO thread,1个master thread,1个锁监控线程,1个错误监控线程.IO thread的 ...
- innodb之线程及IO相关参数介绍
引用链接:http://www.cnblogs.com/henglxm/p/4284504.html 1.IO THREAD: 负责IO的相关线程IO THREAD 1. 参数innodb_wri ...
- C#夯实基础之多线程二:主线程、前台线程与后台线程
我们在<C#夯实基础之多线程一:初识多线程>一文中第二部分中指出,既然windows最终发展出了多线程模型,按理说,我们直接使用一个.NetFramework的线程类就可以直接撸代码了,但 ...
- 开源WinForms界面开发框架Management Studio 选项卡文档 插件 Office 2007蓝色风格 后台线程
Management Studio是我在WinForms小项目开发过程中搭建起来的一个插件式结构的应用程序框架,因为简单灵活又容易扩展,现在将它开源供读者参考. 跑起来的效果图如下所示,具备选项卡式多 ...
随机推荐
- 通读Cheerio文档
前言 cheerio是一款非常实用的nodejs第三方包,适用于服务端(nodejs端)处理html.它有着与jquery及其相似(几乎是一致)的api,速度飞快,使用灵活,而且不仅能够处理html, ...
- ThinkPHP3.2多域名 Virtual .htaccess 匹配 RewriteCond %{HTTP_HOST}
<Files *> Options -Indexes </Files> <IfModule mod_headers.c> <FilesMatch " ...
- ZH奶酪:PHP抓取网页方法总结
From:http://www.jb51.net/article/24343.htm 在做一些天气预报或者RSS订阅的程序时,往往需要抓取非本地文件,一般情况下都是利用php模拟浏览器的访问,通过ht ...
- 安装 mysql-5.6.4-m7
1.首先下载:http://cdn1.mydown.yesky.com/soft/201403/mysql-5.6.4-m7.tar.gz 2.解压,进入目录,执行cmake ./(如果没有cmake ...
- markdown table语法
普通的表格 | 一个普通标题 | 一个普通标题 | 一个普通标题 | | ------ | ------ | ------ | | 短文本 | 中等文本 | 稍微长一点的文本 | | 稍微长一点的文本 ...
- python乱码问题之爬虫篇
UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 167: illegal multibyte sequence 使 ...
- Spring学习笔记三:Bean管理
转载请注明原文地址:http://www.cnblogs.com/ygj0930/p/6775827.html 一:如何使用Spring获取对象 1:定义bean类:要按照注入方式来定义对应的bea ...
- 转发:centos彻底删除文件夹、文件命令(centos 新建、删除、移动、复制等命令)
http://blog.csdn.net/lpdx111/article/details/16877725 centos彻底删除文件夹.文件命令(centos 新建.删除.移动.复制等命令: 1.新建 ...
- Java的一个关于“星球”的枚举
public enum Planet { /** * 水星 */ MERCURY(3.302e+23, 2.439e6), /** * 金星 */ VENUS(4.869e+24, 6.052e6), ...
- java 生成二维码后叠加LOGO并转换成base64
1.代码 见文末推荐 2.测试 测试1:生成base64码 public static void main(String[] args) throws Exception { String dat ...