博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Innodb后台线程
阅读量:6713 次
发布时间:2019-06-25

本文共 4837 字,大约阅读时间需要 16 分钟。

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.251 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: 42 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_idlesrv_master_thread log flush and writes: 26336----------SEMAPHORES----------OS WAIT ARRAY INFO: reservation count 393OS WAIT ARRAY INFO: signal count 347Mutex spin waits 297, rounds 8910, OS waits 281RW-shared spins 53, rounds 1590, OS waits 50RW-excl spins 13, rounds 1860, OS waits 57Spin rounds per wait: 30.00 mutex, 30.00 RW-shared, 143.08 RW-excl------------TRANSACTIONS------------Trx id counter 2545Purge done for trx's n:o < 2540 undo n:o < 0 state: running but idleHistory list length 22LIST OF TRANSACTIONS FOR EACH SESSION:---TRANSACTION 0, not startedMySQL thread id 5, OS thread handle 0x7fcaccfe8700, query id 491 localhost root initshow 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: 0Pending flushes (fsync) log: 0; buffer pool: 0915 OS file reads, 1496 OS file writes, 1089 OS fsyncs0.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 mergesmerged operations: insert 0, delete mark 0, delete 0discarded operations: insert 0, delete mark 0, delete 0Hash table size 276671, node heap has 2 buffer(s)0.00 hash searches/s, 0.00 non-hash searches/s---LOG---Log sequence number 369664448Log flushed up to   369664448Pages flushed up to 369664448Last checkpoint at  3696644480 pending log writes, 0 pending chkp writes356 log i/o's done, 0.00 log i/o's/second----------------------BUFFER POOL AND MEMORY----------------------Total memory allocated 137363456; in additional pool allocated 0Dictionary memory allocated 96365Buffer pool size   8191Free buffers       53Database pages     8136Old database pages 2983Modified db pages  0Pending reads 0Pending writes: LRU 0, flush list 0, single page 0Pages made young 9747, not young 48647160.00 youngs/s, 0.00 non-youngs/sPages read 4212, created 12449, written 133220.00 reads/s, 0.00 creates/s, 0.00 writes/sNo buffer pool page gets since the last printoutPages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/sLRU len: 8136, unzip_LRU len: 0I/O sum[0]:cur[0], unzip sum[0]:cur[0]--------------ROW OPERATIONS--------------0 queries inside InnoDB, 0 queries in queue0 read views open inside InnoDBMain thread process no. 2345, id 140508950664960, state: sleepingNumber of rows inserted 3919015, updated 0, deleted 0, read 85321410.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的工作。

 

转载地址:http://kwalo.baihongyu.com/

你可能感兴趣的文章
Eclipse中将含有图片资源的项目打包成jar文件
查看>>
【剑指offer12】矩阵中的路径(回朔法),C++实现
查看>>
Bzoj2342 [Shoi2011]双倍回文
查看>>
git-git使用
查看>>
Kubernetes安装
查看>>
MyBatis(1)优点&介绍&工程
查看>>
类UNIX操作系统概念
查看>>
常用Eclipse快捷方式
查看>>
树上各种DFS姿势算法笔记
查看>>
Windbg学习 (0x0008) 命令-符号文件/符号
查看>>
1、脱硫塔工作原理
查看>>
mysql存储过程变量的拼接
查看>>
laravel 加载指定版本的mongodb
查看>>
给pcm格式文件加wav文件头
查看>>
高精度模板(含加减乘除四则运算)
查看>>
[Swust OJ 797]--Palindromic Squares(回文数水题)
查看>>
【Java】提取JSON数值时遇到数组集合时使用的K-V方式转换
查看>>
ZigZag Conversion
查看>>
Linux杂记
查看>>
关于Mvvm的一些深入理解
查看>>