top -H -p PID
ps -T -p PID
mysql -uroot -S /var/lib/mysql/mysql.sock -p
特点:行锁设计、支持MMCC、支持外键、提供一致性非锁定读,同时被设计用来最有效地利用以及使用内存和CPU。
后台线程:主要作用是负责刷新内存池中的数据,保证缓冲池中的内存缓存的是最近的数据。此外将已修改的数据文件刷新到磁盘文件,同时保证在数据库发生异常的情况下InnoDB能恢复到正常运行状态。
Master Thread
:核心后台线程,主要负责将缓冲池中的数据异步刷新到磁盘,保证数据的一致性,包括脏页的刷新,合并插入缓冲(Insert Buffer)、UNDO页的回收等。I/O Thread
:在InnoDB中大量使用AIO(Async I/O)来处理I/O请求,这样可以极大提高数据库的性能。而I/O Thread的主要工作就是负责这些I/O请求的回调处理。主要有4个I/O Thread,write、read、insert buffer和log I/O Thread。mysql> show variables like 'innodb_%io_threads';
+-------------------------+-------+
| Variable_name | Value |
+-------------------------+-------+
| innodb_read_io_threads | 4 |
| innodb_write_io_threads | 4 |
+-------------------------+-------+
mysql> show engine innodb status\G
......
FILE I/O
--------
I/O thread 0 state: waiting for completed aio requests (insert buffer thread)
I/O thread 1 state: waiting for completed aio requests (log thread)
I/O thread 2 state: waiting for completed aio requests (read thread)
I/O thread 3 state: waiting for completed aio requests (read thread)
I/O thread 4 state: waiting for completed aio requests (read thread)
I/O thread 5 state: waiting for completed aio requests (read thread)
I/O thread 6 state: waiting for completed aio requests (write thread)
I/O thread 7 state: waiting for completed aio requests (write thread)
I/O thread 8 state: waiting for completed aio requests (write thread)
I/O thread 9 state: waiting for completed aio requests (write thread)
Pending normal aio reads: [0, 0, 0, 0] , aio writes: [0, 0, 0, 0] ,
ibuf aio reads:, log i/o's:, sync i/o's:
Pending flushes (fsync) log: 0; buffer pool: 0
841 OS file reads, 3440 OS file writes, 2064 OS fsyncs
0.00 reads/s, 0 avg bytes/read, 0.00 writes/s, 0.00 fsyncs/s
mysql> show variables like 'innodb_purge_threads';
+----------------------+-------+
| Variable_name | Value |
+----------------------+-------+
| innodb_purge_threads | 4 |
+----------------------+-------+
内存
缓冲池缓存的数据页类型有:索引页,数据页,undo页,插入缓冲(insert buffer),自适应哈希索引(adaptive hash index),InnoDB存储的锁信息(lock info),数据字典信息(data dictionary)等
mysql> show variables like 'innodb_buffer_pool_size';
+-------------------------+-----------+
| Variable_name | Value |
+-------------------------+-----------+
| innodb_buffer_pool_size | 134217728 |
+-------------------------+-----------+
mysql> select pool_id,pool_size,free_buffers,database_pages from information_schema.innodb_buffer_pool_stats;
+---------+-----------+--------------+----------------+
| pool_id | pool_size | free_buffers | database_pages |
+---------+-----------+--------------+----------------+
| 0 | 8192 | 6939 | 1240 |
+---------+-----------+--------------+----------------+
1 row in set (0.00 sec)
缓冲池可以配置多个:innodb_buffer_pool_instances,每个页根据哈希值平均分配到不同的缓冲池实例中。这样做的好处是减少数据库内部的资源竞争,增加数据库的并发处理能力。
缓冲池通过LRU(最近最少使用)算法来进行管理。但是做了一些优化,读取到新的页,首先放入midpoint位置,距离尾端37%,由参数innodb_old_blocks_pct决定,midpoint后的列表称为old列表,之前的列表称为new列表。old列表的页需要等待innodb_old_blocks_time(ms)后才会加入new端。
mysql> show variables like 'innodb_old_blocks_%';
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| innodb_old_blocks_pct | 37 |
| innodb_old_blocks_time | 1000 |
+------------------------+-------+
-- 查询PAGES_MADE_YOUNG
mysql> SELECT POOL_ID,HIT_RATE,PAGES_MADE_YOUNG,PAGES_NOT_MADE_YOUNG FROM `information_schema`.`INNODB_BUFFER_POOL_STATS`;
-- 查询脏页名称 null表示该页属于系统表空间
mysql> select table_name,space,page_number,page_type from information_schema.innodb_buffer_page_lru where oldest_modification>0;
+------------+-------+-------------+-------------------+
| table_name | space | page_number | page_type |
+------------+-------+-------------+-------------------+
| NULL | 0 | 1785896 | UNDO_LOG |
| NULL | 0 | 1785895 | UNDO_LOG |
| NULL | 0 | 0 | FILE_SPACE_HEADER |
| NULL | 0 | 1753088 | EXTENT_DESCRIPTOR |
| NULL | 0 | 197 | SYSTEM |
| NULL | 0 | 219 | SYSTEM |
| NULL | 0 | 1622016 | EXTENT_DESCRIPTOR |
| NULL | 0 | 6 | SYSTEM |
| NULL | 0 | 785 | UNDO_LOG |
| NULL | 0 | 48 | SYSTEM |
| NULL | 0 | 1785916 | UNDO_LOG |
mysql> show engine innodb status\G
---BUFFER POOL 7
Buffer pool size 196608
Free buffers 1024
Database pages 176905
Old database pages 65282
Modified db pages 14106
Pending reads 0
Pending writes: LRU 0, flush list 0, single page 0
Pages made young 239341807, not young 2439814636
0.00 youngs/s, 0.00 non-youngs/s
Pages read 93481255, created 1123927, written 68416385
0.00 reads/s, 0.00 creates/s, 0.00 writes/s
Buffer pool hit rate 1000 / 1000, young-making rate 0 / 1000 not 1 / 1000
Pages read ahead 0.00/s, evicted without access 0.00/s, Random read ahead 0.00/s
LRU len: 176905, unzip_LRU len: 0
I/O sum[5505]:cur[0], unzip sum[0]:cur[0]
LOG
---
Log sequence number 5103200757074
Log flushed up to 5103200756814
Last checkpoint at 5103200592522
Max checkpoint age 7782360
Checkpoint age target 7539162
Modified age 164552
Checkpoint age 164552
0 pending log writes, 0 pending chkp writes
19381381 log i/o's done, 4.15 log i/o's/second
mysql> show engine innodb status\G
Per second averages calculated from the last 21 seconds
-----------------
BACKGROUND THREAD
-------MySQL8.0----------
srv_master_thread loops: 69 srv_active, 0 srv_shutdown, 593077 srv_idle
srv_master_thread log flush and writes: 0
--------MySQL5.7---------
srv_master_thread loops: 1833639 1_second, 1833599 sleeps, 167935 10_second, 403465 background, 403460 flush
srv_master_thread log flush and writes: 4830842
-- seg size表示插入缓冲大小13777*16KB
-- free list len 空闲列表长度
-- size 已经合并记录页的数量
-- insert表示Insert Buffer,delete mark表示Delete Buffer,delete表示Purge Buffer
Ibuf: size 1, free list len 13775, seg size 13777, 72498876 merges
merged operations:
insert 96870751, delete mark 30149375, delete 2657293
discarded operations:
insert 0, delete mark 0, delete 0
两次写(double Write)
:Insert Buffer带给InnoDB的是性能上的提升,而Double Write带给InnoDB的是数据的可靠性
MySQL [(none)]> show status like 'innodb_db%';
+----------------------------+-----------+
| Variable_name | Value |
+----------------------------+-----------+
| Innodb_dblwr_pages_written | 558784920 | // 写入页数
| Innodb_dblwr_writes | 71333774 | // 写入次数
自适应哈希索引(Adaptive Hash Index)
:InnoDB会监控对标上各索引页的查询。如果观察到建立哈希索引可以带来速度提升,则建立哈希索引,称之为自适应哈希索引AHI。32733.05 hash searches/s, 2329.60 non-hash searches/s
INSERT BUFFER AND ADAPTIVE HASH INDEX
-------------------------------------
Ibuf: size 1, free list len 13775, seg size 13777, 72504172 merges
merged operations:
insert 96875364, delete mark 30150187, delete 2657308
discarded operations:
insert 0, delete mark 0, delete 0
Hash table size 6375023, node heap has 8693 buffer(s)
Hash table size 6375023, node heap has 7233 buffer(s)
Hash table size 6375023, node heap has 9478 buffer(s)
Hash table size 6375023, node heap has 55587 buffer(s)
Hash table size 6375023, node heap has 15621 buffer(s)
Hash table size 6375023, node heap has 6443 buffer(s)
Hash table size 6375023, node heap has 44123 buffer(s)
Hash table size 6375023, node heap has 7376 buffer(s)
32733.05 hash searches/s, 2329.60 non-hash searches/s
mysql> show variables like 'innodb_flush_neighbors';
+------------------------+-------+
| Variable_name | Value |
+------------------------+-------+
| innodb_flush_neighbors | 0 |
+------------------------+-------+
[root@test001 mysql]# ls
'#ib_16384_0.dblwr' cp_audio mysqlx.sock
'#ib_16384_1.dblwr' ib_buffer_pool mysqlx.sock.lock
'#innodb_temp' ib_logfile0 performance_schema
auto.cnf ib_logfile1 private_key.pem
binlog.000001 ibdata1 public_key.pem
binlog.000002 ibtmp1 server-cert.pem
binlog.index mysql server-key.pem
ca-key.pem mysql.ibd sys
ca.pem mysql.sock undo_001
client-cert.pem mysql.sock.lock undo_002
client-key.pem mysql_upgrade_info
参数类型:动态参数,可运行时修改,静态参数:生命周期内不可修改
mysql> set read_buffer_size=524288;
mysql> select @@session.read_buffer_size;
+----------------------------+
| @@session.read_buffer_size |
+----------------------------+
| 524288 |
+----------------------------+
mysql> select @@global.read_buffer_size;
+---------------------------+
| @@global.read_buffer_size |
+---------------------------+
| 131072 |
+---------------------------+
mysql> set @@global.read_buffer_size=264800;
mysql> select @@global.read_buffer_size;
+---------------------------+
| @@global.read_buffer_size |
+---------------------------+
| 262144 |
+---------------------------+
mysql> show variables like 'log_error';
+---------------+---------------------------+
| Variable_name | Value |
+---------------+---------------------------+
| log_error | /var/log/mysql/mysqld.log |
+---------------+---------------------------+
long_query_time 慢查询阈值
log_slow_queries 慢查询是否打开(该参数要被slow_query_log取代,做兼容性保留) set global log_slow_queries = ON;
log_queries_not_using_indexes:当SQL没有使用索引,是否会记录到慢查询日志
log_throttle_queries_not_using_indexes:允许每分钟记录到慢查询日志文件的日志条数,0为不限制
slow_query_log 慢日志是否打开
slow_query_log_file 慢日志文件
mysqldumpslow cptest003-slow.log :慢日志分析
show variables like '%general%';
+------------------+---------------+
| Variable_name | Value |
+------------------+---------------+
| general_log | OFF |
| general_log_file | cptest003.log |
+------------------+---------------+
show master status
show binlog events in 'binlog.000002' limit 200 -- 查看日志
共享表空间文件
ibdata1。innodb_data_file_path :ibdata1:10M:autoextend,表示初始为10M,用完自动扩展独立的表空间
。命名规则为 表名.ibdbinlog和redo log的区别
# ruby新版本安装 https://blog.csdn.net/loveshunyi/article/details/99583505
yum install ruby
gem install innodb_ruby
ruby -r rubygems -I lib bin/innodb_space -f /var/lib/mysql/ibdata1 space-page-type-summary
type count percent description
INDEX 1556538 85.56 B+Tree index
ALLOCATED 145864 8.02 Freshly allocated
BLOB 96661 5.31 Uncompressed BLOB
UNDO_LOG 19326 1.06 Undo log
IBUF_FREE_LIST 246 0.01 Insert buffer free list
INODE 237 0.01 File segment inode
SYS 168 0.01 System internal
IBUF_BITMAP 110 0.01 Insert buffer bitmap
XDES 110 0.01 Extent descriptor
FSP_HDR 2 0.00 File space header
TRX_SYS 2 0.00 Transaction system header
记录头最后两个字节表示下一条记录相对于本条记录的相对偏移。所以InnoDB在页内部是通过一条链表的结构串联各个行记录的。
MySQL定义一行长度为65535是指所有VARCHAR列的长度总和,超过则不能创建,需要使用text。InnoDB页为16KB,怎么存放65532个字节呢?在一般情况下,数据存放在B-tree node中。但是当发生行溢出时,数据存放在页类型为Uncompress BLOB页中。要保证数据存放在数据页中,需要保证每一个页存放两条数据,阈值长度为8098。
当使用text或者BLOB的数据类型,如果能保证一个数据页存放两条数据,也会采用数据页存放。mysql> create table test( a varchar(65532))charset=utf8;
ERROR 1074 (42000): Column length too big for column 'a' (max = 21845); use BLOB or TEXT instead
mysql> create table test( a varchar(65532))charset=utf8mb4;
ERROR 1074 (42000): Column length too big for column 'a' (max = 16383); use BLOB or TEXT instead
InnoDB数据页中的Page Directory中存放了记录的相对位置,但并不是每一条记录都有相对位置。B+树索引本身并不能找到具体的一条记录,能找到的只是记录所在的页。数据库把页载入到内存中,然后从Page Directory再进行二叉查找,找到一个粗略的结果,此时采用记录内的header的next_record来继续查找相关记录。
创建分区时,如果表中存在主键或唯一索引时,分区列必须是唯一索引的一个组成部分。
create table t1(
col1 int not null,
col2 int not null,
col3 int not null,
col4 int not null,
unique key (col1,col2))
partition by hash(col3) partitions 4;
ERROR 1503 (HY000): A PRIMARY KEY must include all columns in the table's partitioning function (prefixed columns are not considered).
采用分区表不一定能提升性能,假如对于一张大表1000w数据,没有采用分区表前为3层B+树,采用10个分区,每个分区B+树层级为2,那么如果扫描10个分区,就需要进行20次IO,而之前的表只需要2次IO,这样性能就会急剧下降。
B+树索引并不能找到一个给定键值的具体行。B+树索引能找到的只是被查找数据行所在的页。然后数据库通过把页读入到内存,再在内存中进行查找,最后得到查找的数据。
聚集索引的存储并不是物理上连续的,而是逻辑上连续的。
Cardinality值非常关键,优化器会根据这个值来判断是否使用这个索引。但是这个值不是实时更新的,即并非每次索引的更新都会更新该值,因为这样代价太大了。
mysql> show index from wm_user_user\G
......
*************************** 3. row ***************************
Table: wm_user_user //
Non_unique: 1 // 是否为非唯一索引
Key_name: name
Seq_in_index: 1 // 索引中该列的位置,对于联合索引 a_c,c就为2
Column_name: user_name
Collation: A // 列以什么方式存储在索引中。B+树的索引总是A
Cardinality: 175359 // 索引中唯一值的数目的估计值
Sub_part: NULL // 是否是列的部分被索引。全列索引为NULL,name(100)部分索引则为100
Packed: NULL
Null: // 索引中是否存在null值
Index_type: BTREE
Comment:
Index_comment:
执行创建或者删除操作的同时,将INSERT、UPDATE、DELETE这类DML操作日志写入到一份缓存中。待完成索引创建后再重做应用到表上,以此达到数据的一致性。
缓存innodb_online_alter_log_max_size默认大小为128M,如果更新的表比较大,而且有大量的写事务,当缓存空间不够存放日志时,会报错,调大缓存日志即可。mysql> show variables like "innodb_online%";
+----------------------------------+-----------+
| Variable_name | Value |
+----------------------------------+-----------+
| innodb_online_alter_log_max_size | 134217728 |
mysql> show variables like "innodb_stats%";
+--------------------------------------+-------------+
| Variable_name | Value |
+--------------------------------------+-------------+
| innodb_stats_auto_recalc | ON |
| innodb_stats_include_delete_marked | OFF |
| innodb_stats_method | nulls_equal | // 所有null值为一个记录
| innodb_stats_on_metadata | OFF |
| innodb_stats_persistent | ON |
| innodb_stats_persistent_sample_pages | 20 | // 表示analyze table test,更新Cardinality值的每次采样数目
| innodb_stats_transient_sample_pages | 8 | // 表示系统采样的页数
+--------------------------------------+-------------+
Using index
就是代表了优化器进行覆盖索引操作。-- user_id是主键,采用强制索引或者索引提示之后不再使用索引查询,但是用到了索引覆盖。
mysql> explain select * from users USE INDEX(tel) WHERE user_id=100;
+------+-------------+--------------+------+---------------+------+---------+------+--------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+--------------+------+---------------+------+---------+------+--------+-------------+
| 1 | SIMPLE | users | ALL | NULL | NULL | NULL | NULL | 175359 | Using where |
+------+-------------+--------------+------+---------------+------+---------+------+--------+-------------+
mysql> explain select * from users FORCE INDEX(tel) WHERE user_id=100;
+------+-------------+--------------+------+---------------+------+---------+------+--------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+--------------+------+---------------+------+---------+------+--------+-------------+
| 1 | SIMPLE | users | ALL | NULL | NULL | NULL | NULL | 175359 | Using where |
+------+-------------+--------------+------+---------------+------+---------+------+--------+-------------+
Multi-Range Read(MRR)优化
:目的就是为了减少磁盘的随机访问,并将随机访问转化为较为顺序的数据访问。
索引下推
(index condition pushdown)ICP:
Using index condition
,表示已经使用了索引下推。哈希索引只能用来搜索等值的查询。
,下面包含自适应哈希大小,每秒哈希查询数和非哈希查询数。mysql> show engine innodb status\G
Hash table size 3104531, node heap has 3105 buffer(s)
0.00 hash searches/s, 0.00 non-hash searches/s
mysql> show engine innodb mutex;
+--------+----------------------------+---------+
| Type | Name | Status |
+--------+----------------------------+---------+
| InnoDB | rwlock: fil0fil.cc:3337 | waits=1 |
| InnoDB | sum rwlock: buf0buf.cc:784 | waits=5 |
+--------+----------------------------+---------+
在事务隔离级别READ COMMITTED和REPEATABLE READ(InnoDB默认)下,InnoDB使用非一致性读。然而对于快照数据的定义是不同的。在READ COMMITTED事务级别下,对于快照数据,非一致性读总是读取被锁定行的最新一份快照数据。而在REPEATABLE READ事务隔离级别下,对于快照数据,非一致性读总是读取事务开始的时的行数据版本。
原子性。指整个数据库事务是一个不可分割的工作单位
。要么都做,要么都不做。只有使事务中所有的数据库操作都执行成功,才算事务成功。否则,已近执行的SQL必须撤销,数据库状态回到修改前的状态。一致性。指事务将数据库从一种状态转变为下一种一致的状态。
在事务开始之前和事务结束之后,数据库的完整性约束没有被破坏。例如,在一个有唯一约束的姓名字段,如果事务对姓名修改,导致了姓名字段变为非唯一,这就破坏了事务的一致性要求,即事务将数据库从一种状态变为了一种不一致的状态。因此,事务是一致性的单位,如果事务中某个操作失败了,系统可以自动撤销事务——返回初始化状态。事务的隔离性要求每个读写事务的对象对其他事务的操作对象能相互分离,即该事务提交前对其他事务都不可见,通常这使用锁来实现
。持久性。事务一旦提交,其结果就是永久性的。即使发生宕机等故障,数据库也能将数据恢复。
需要注意的是,只能从事务本身的角度来保证结果的永久性。例如,在事务提交后,所有的变化都是永久的。即使数据库因为崩溃而需要恢复时,也能保证恢复后提交的数据不会丢失。但若不是数据库本身发生了故障,而是一些外部原因,如RAID卡损坏、自然灾害等原因导致数据库发生问题,那么所提交的数据可能都会丢失。因此持久性保证事务系统的高可靠性(High Reliability),而不是高可用性(High Availability)。对于高可用性的实现,事务本身并不能保证,需要一些系统共同配合完成。
扁平事务
:在扁平事务中,所有的操作都在同一层次,其由BEGIN WORK开始,由COMMIT WORK或ROLLBACK WORK结束,其间的操作是原子的,要么都执行,要么都回滚。因此扁平事务是应用程序成为原子操作的基本组成模块。链事务的思想是:在提交一个事务时,释放不需要的数据对象,将必要的处理上下文隐式地传给下一个要开始的事务。注意,提交事务操作和开始下一个事务操作将合并为一个原子操作。这意味着下一个事务将看到上一个事务的结果,就好像在一个事务中进行一样
对于InnoDB来说,其支持扁平事务、带有保存点的事务、链事务、分布式事务。
1,默认
,事务提交时必须调用一次fsync操作mysql> show engine innodb status\G
LOG
---
Log sequence number 5122679714160 // 当前LSN
Log flushed up to 5122679714160 // 刷新到重做日志文件的LSN
Last checkpoint at 5122679714160 // 刷新到磁盘的LSN
Max checkpoint age 7782360
Checkpoint age target 7539162
Modified age 0
Checkpoint age 0
0 pending log writes, 0 pending chkp writes
22279373 log i/o's done, 0.00 log i/o's/second
当事务提交时,首先将undo log放入链表中,然后判断undo页的使用空间是否小于3/4,若是则表示该undo页可以被重用,之后新的undo log记录在当前undo log后。由于存放undo log的列表是以记录进行组织的,而undo页可能存放着不同事务的undo log,因此purge操作需要涉及磁盘的离散读取操作,这是一个比较缓慢的过程。
TRANSACTIONS
------------
Trx id counter 14559729364
Purge done for trx's n:o < 14559729357 undo n:o < 0 state: running but idle
History list length 295
mysql> show global statuscom_commit'\G
*************************** 1. row ***************************
Variable_name: Com_commit
Value: 95
mysql> show global status like 'com_rollback'\G
*************************** 1. row ***************************
Variable_name: Com_rollback
Value: 31
// create table t(a int primary key);
function XAProcess($upId){
$pdo1 = new PDO ("mysql:host=101.0.0.1;dbname=test;port=3306;charset=utf8mb4", "root", "123456", array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_TIMEOUT => 2,
));
$pdo2 = new PDO ("mysql:host=10.0.0.2;dbname=test;port=3306;charset=utf8mb4", "root", "123456", array(
PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,
PDO::ATTR_TIMEOUT => 2,
));
$xid = uniqid();
$pdo1->query("XA START '{$xid}'");
$pdo2->query("XA START '{$xid}'");
try {
$pdo1->exec("INSERT INTO t select {$upId}");
$pdo2->exec("INSERT INTO t select {$upId}");
$pdo1->query("XA END '{$xid}'");
$pdo1->query("XA PREPARE '{$xid}'");
$pdo2->query("XA END '{$xid}'");
$pdo2->query("XA PREPARE '{$xid}'");
$pdo1->query("XA COMMIT '{$xid}'");
$pdo2->query("XA COMMIT '{$xid}'");
} catch (Exception $e) {
$pdo1->query("XA END '{$xid}'");
$pdo1->query("XA PREPARE '{$xid}'");
$pdo2->query("XA END '{$xid}'");
$pdo2->query("XA PREPARE '{$xid}'");
$pdo1->query("XA ROLLBACK '{$xid}'");
$pdo2->query("XA ROLLBACK '{$xid}'");
var_dump($e->getMessage());
}
}
mysqldump -uroot -p --single-transaction --databases test>test_backup.sql
SELECT * INTO OUTFILE '/home/work/a.txt' from a;
find / -name 'oltp*.lua'
sysbench /usr/local/Cellar/sysbench/1.0.20/share/sysbench/oltp_read_write.lua --mysql-user=root --mysql-password=123456 --mysql-host=127.0.0.1 --tables=5 --table_size=1000000 --threads=10 --time=30 --report-interval=3 prepare
sysbench /usr/local/Cellar/sysbench/1.0.20/share/sysbench/oltp_read_write.lua --mysql-user=root --mysql-password=123456 --mysql-host=127.0.0.1 --tables=5 --table_size=1000000 --threads=10 --time=30 --report-interval=3 run
sysbench /usr/local/Cellar/sysbench/1.0.20/share/sysbench/oltp_read_write.lua --mysql-user=root --mysql-password=123456 --mysql-host=127.0.0.1 --tables=5 --table_size=1000000 --threads=10 --time=30 --report-interval=3 cleanup
#--threads:表示线程数
#--time:表示执行时间
#--report-interval:表示间隔多少秒输出测试信息