MySQL Study之--MySQL体系结构深入解析

MySQL体系架构

由连接池组件、管理服务和⼯工具组件、sql接口组件、查询分析器组件、优化器组件、缓冲组件、插件式存储引擎、物理⽂文件组成。mysql是独有的插件式体系结构,各个存储引擎有自己的特点。

MySQL内存结构:

watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQv/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/Center" alt="">

Mysql 进程结构

Mysql不像oracle那样是通过多进程来完毕其功能的。默认情况下,InnoDB存储引擎的后台线程有7个:

4个IO thread,

1个master thread,

1个锁(lock)监控线程。

1个错误监控线程。

在InnoDB Plugin版本号開始添加了默认IO thread的数量,默认的read thread和write thread分别增大到了4个。而且不再使用innodb_file_ io_threads參数,而是分别使用innodb_read_io_threads和innodb_write_io_threads參数。

查看mysql thread:

<strong><span style="font-size:14px;">mysql> show variables like 'innodb_%version%';</span></strong>
+----------------+-------+
| Variable_name | Value |
+----------------+-------+
| innodb_version | 1.2.4 |
+----------------+-------+
1 row in set (0.00 sec)
<strong><span style="font-size:14px;">mysql> show engine innodb status;</span></strong>
=====================================
150709 15:26:40 INNODB MONITOR OUTPUT
=====================================
Per second averages calculated from thelast 12 seconds
-----------------
BACKGROUND THREAD
-----------------
srv_master_thread loops: 0 srv_active, 0srv_shutdown, 804 srv_idle
srv_master_thread log flush and writes: 804
----------
SEMAPHORES
----------
OS WAIT ARRAY INFO: reservation count 2
OS WAIT ARRAY INFO: signal count 2
Mutex spin waits 0, rounds 0, OS waits 0
RW-shared spins 2, rounds 60, OS waits 2
RW-excl spins 0, rounds 0, OS waits 0
Spin rounds per wait: 0.00 mutex, 30.00RW-shared, 0.00 RW-excl
------------
TRANSACTIONS
------------
Trx id counter 5377
Purge done for trx's n:o < 4872 undo n:o< 0
History list length 1
LIST OF TRANSACTIONS FOR EACH SESSION:
---TRANSACTION 0, not started
MySQL thread id 3, OS thread handle0x7f1656c75700, query id 5 localhost root init
show engine innodb status
--------
FILE I/O
--------
<strong>I/O thread 0 state: waiting for completedaio requests (insert buffer thread)
I/O thread 1 state: waiting for completedaio requests (log thread)
I/O thread 2 state: waiting for completedaio requests (read thread)
I/O thread 3 state: waiting for completedaio requests (read thread)
I/O thread 4 state: waiting for completedaio requests (read thread)
I/O thread 5 state: waiting for completedaio requests (read thread)
I/O thread 6 state: waiting for completedaio requests (write thread)
I/O thread 7 state: waiting for completedaio requests (write thread)
I/O thread 8 state: waiting for completedaio requests (write thread)
I/O thread 9 state: waiting for completedaio requests (write thread)
Pending normal aio reads: 0 [0, 0, 0, 0] ,aio writes: 0 [0, 0, 0, 0] ,</strong>
ibufaio reads: 0, log i/o's: 0, sync i/o's: 0
Pending flushes (fsync) log: 0; bufferpool: 0
283 OS file reads, 5 OS file writes, 5 OSfsyncs
0.00 reads/s, 0 avg bytes/read, 0.00writes/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 276707, node heap has 0buffer(s)
0.00 hash searches/s, 0.00 non-hashsearches/s
---
LOG
---
Log sequence number 1611537
Log flushed up to 1611537
Pages flushed up to 1611537
Last checkpoint at 1611537
0 pending log writes, 0 pending chkp writes
8 log i/o's done, 0.00 log i/o's/second
----------------------
BUFFER POOL AND MEMORY
----------------------
Total memory allocated 137363456; inadditional pool allocated 0
Dictionary memory allocated 39010
Buffer pool si
posted @
2017-06-26 08:23 
wzzkaifa 
阅读(...) 
评论(...) 
编辑 
收藏

MySQL Study之--MySQL体系结构深入解析的更多相关文章

  1. MySQL Study之--MySQL用户及权限管理

    MySQL Study之--MySQL用户及权限管理     MySQLserver通过MySQL权限表来控制用户对数据库的訪问.MySQL权限表存放在mysql数据库里.由mysql_install ...

  2. MySQL Study之--Mysql无法启动“mysql.host”

    MySQL Study之--Mysql无法启动"mysql.host" 系统环境: 操作系统:RedHat EL55 DB Soft:  Mysql 5.6.4-m7 通过源代码包 ...

  3. MySQL Study之--MySQL schema_information数据库

    MySQL Study之--MySQL schema_information数据库       information_schema数据库是在mysql的版本号5.0之后产生的,一个虚拟数据库,物理上 ...

  4. MySQL Study之--MySQL普通用户无法本地登陆

    MySQL Study之--MySQL普通用户无法本地登陆       在安装完毕MySQL后,我们通常加入拥有对应权限的普通用户用来訪问数据库.在使用用户本地登录数据库的时候,常常会出现怎么登录也无 ...

  5. MySQL Study之--MySQL下图形工具的使用(MySQL Administrator)

    MySQL Study之--MySQL下图形工具的使用(MySQL Administrator) 系统环境:     操作系统: Windows  7(64) 下载地址:http://www.soft ...

  6. MySQL Study之--MySQL压力測试工具mysqlslap

    MySQL Study之--MySQL压力測试工具mysqlslap 一.Mysqlslap介绍     mysqlslap是MySQL5.1之后自带的benchmark基准測试工具,类似Apache ...

  7. MySQL学习笔记-MySQL体系结构总览

    MySQL体系结构总览 不管是用哪种数据库,了解数据库的体系结构都是极为重要的.MySQL体系结构主要由数据库和数据库实例构成. 数据库:物理操作系统文件或者其它文件的集合,在mysql中,数据库文件 ...

  8. MySQL的JDBC驱动源码解析

    原文:   MySQL的JDBC驱动源码解析 大家都知道JDBC是Java访问数据库的一套规范,具体访问数据库的细节有各个数据库厂商自己实现 Java数据库连接(JDBC)由一组用 Java 编程语言 ...

  9. MySQL中的xtrabackup的原理解析

    xtrabackup的官方下载地址为 http://www.percona.com/software/percona-xtrabackup. xtrabackup包含两个主要的工具,即xtraback ...

随机推荐

  1. NPM 国内镜像使用方法

    npm官方站点: http://www.npmjs.org/ 本文使用国内镜像地址: http://www.cnpmjs.org/ 搜索镜像:https://npm.taobao.org/ 具体方法: ...

  2. Python-控制流

    if #!/usr/bin/python number=23 guess=int(input('Enter an interger:')) #input返回的结果是string类型,需要用int()转 ...

  3. Dubbo的@Reference和@Service说明---1Reference用在消费者2Service用在提供者【import com.alibaba.dubbo.config.annotation.Service;】

    @Reference 用在消费端,表明使用的是服务端的什么服务@RestControllerpublic class RemoteUserController { @Reference(version ...

  4. Eclipse 每次ctrl-c ctrl-v 就变慢?

    继续闲着,所以继续写 大小: 60.7 KB 查看图片附件

  5. MySQL Connector for .NET 和 EF版本匹配问题

    以下讨论的都是EF5.0, 版本号:4.4.0.0 如果装了MySQL 5.0.1 , 那么最好用MySQL Connector 6.3.6,但是创建数据库后,生成迁移历史表的时候,会报错,你不管,直 ...

  6. Android RxVolley = Volley + RxJava + OkHttp

    Github:https://github.com/kymjs/RxVolley RxVolley使用文档 V1.0:http://rxvolley.mydoc.io/ 一.RxVolley使用指南 ...

  7. MTK刷机工具Flash_Tool部分4032错误解决办法

    MTK刷机工具Flash_Tool部分4032错误解决办法 先说明一点,这个办法不是万能的,我测试解决了以下两种情况下的4032: 1.本来正常的开发板,因为一次刷机失败后就一直变4032了 2.新开 ...

  8. SQL Server 一个简单的游标

    先看一下原表: DECLARE @id INT; DECLARE @name NVARCHAR(100); DECLARE c_department CURSOR FOR SELECT StuID, ...

  9. 【SQL】约束

    1. 添加约束 1)使用ALTER TABLE语句 •添加或删除约束,不会修改其结构 •启用和禁用约束 •通过使用MODIFY子句添加NOTNULL约束 ALTER TABLE <table_n ...

  10. ubuntu 16.04 安装QT问题

    使用 sudo  sh ./**.run  有错误: 增加 文件的可运行权限: sudo chmod +x Qt.run 直接运行: ./Qt.run 可完成安装