New flash cache solution is here: |
| innodb_buffer_pool | innodb_secondary_buffer_pool | read-write(tps) |
| 8G | 0G | 55.03 |
| 8G(sbtest on SSD) | 0G | 60.8 |
| 8G | 30G | 86.23 |
TPC-C benchmark
Server: Intel(R) Xeon Quad-Core E5405 2.00GHz X 2
Database: 9G ( created by tpcc_load, 100 warehouse )
disk: 4 disk RAID 10 flash storage: Intel X25-M 80G SSD
MySQL configuration:
| innodb_flush_log_at_trx_commit | 1 | | innodb_flush_method | O_DIRECT |
tpcc-mysql: tpcc_start 127.0.0.1 tpcc root '123456' 10 16 1 7200
| innodb_buffer_pool | innodb_secondary_buffer_pool | result(tpmC) |
| 4G | 30G | 10543.02 |
| 4G(tpcc on SSD) | 0 | 10771.2 |
Configuration
1. create the file on flash memory, we use this file as secondary buffer pool. (In windows, InnoDB will auto create this file)
[root@xen-server ~]# dd if=/dev/zero of=ib_sbpfile bs=16384 count=58880 [root@xen-server ~]# chown mysql:mysql ib_sbpfile
2. edit the my.cnf file, add followings:
[mysqld] innodb-secondary-buffer-pool-size=920M innodb-secondary-buffer-pool-file=/flash/ib_sbpfile innodb_secondary_buffer_pool_preload_table=tpcc.*:test.t
3. watch secondary buffer pool status using show innodb status\G:
mysql> show engine innodb status\G; *************************** 1. row *************************** ...... ---------------------- SECONDARY BUFFER POOL ---------------------- Secondary buffer pool size 58880 Free pages 126 LRU pages 58754 Page reads 971180, sync 548939, swap 490185 Secondary buffer pool hit rate 916 / 1000 (in 23.00 sec) 649.10 reads/s, 334.16 sync/s, 336.25 swap/s (in 23.00 sec) ......
4. new innodb status variables:
mysql> show global status like 'innodb_sec%'; +----------------------------------------------------+--------+ | Variable_name | Value | +----------------------------------------------------+--------+ | Innodb_secondary_buffer_pool_reads | 269080 | | Innodb_secondary_buffer_pool_sync | 201435 | | Innodb_secondary_buffer_pool_swap | 214080 | | Innodb_secondary_buffer_pool_make_young | 269080 | | Innodb_secondary_buffer_pool_skip_unuseful | 9325 | | Innodb_secondary_buffer_pool_skip_write_overloaded | 0 | +----------------------------------------------------+--------+ 6 rows in set (0.00 sec)
5. after enable innodb_secondary_buffer_pool_preload_table, you will see the following lines in .err file:
100329 11:09:55 InnoDB: preloading table tpcc.warehouse to secondary buffer pool.(0.00%) 100329 11:09:55 InnoDB: preloading table tpcc.item to secondary buffer pool.(0.00%) 100329 11:09:55 InnoDB: preloading table tpcc.new_orders to secondary buffer pool.(1.01%) 100329 11:09:55 InnoDB: preloading table tpcc.history to secondary buffer pool.(1.27%) 100329 11:09:55 InnoDB: preloading table tpcc.district to secondary buffer pool.(4.57%) 100329 11:09:55 InnoDB: preloading table tpcc.customer to secondary buffer pool.(4.57%) 100329 11:09:56 InnoDB: preloading table tpcc.order_line to secondary buffer pool.(25.85%) 100329 11:09:56 InnoDB: preloading table tpcc.orders to secondary buffer pool.(57.90%) 100329 11:09:57 InnoDB: preloading table tpcc.stock to secondary buffer pool.(60.12%) 100329 11:09:57 InnoDB: preloading to secondary buffer pool finish.
Next New Feature
- allow to pin the table into secondary buffer pool.
- add LRU aglorithm to secondary buffer pool.
- add secondary buffer pool status info to INFORMATION_SCHEMA.
该项目已被收录到 http://www.oschina.net/p/david-mysql-tools
请问下,1:insert 或者delete执行时,数据是被刷新到缓存上,还是直接刷新到磁盘上 2:能否解释下 334.16 sync/s, 336.25 swap/s的含义,谢谢拉 我邮箱linuxyt@gmail.com
3:还问下,如果cache满了,他里面的准备flush的数据是直接删除,还是flush到后端的磁盘上。
how can I use in percona xtraDB?
我也想知道二楼提到的问题是怎么解决的? 我记得您在书中说过,SSD的写效率是很低的,我觉得应该是直接写磁盘吧!
再请问个问题,除了INNODB_BUFFER_POOL的页被删除时才将页刷到SSD外还有什么时候写SSD呢?