Hunter的大杂烩 技术学习笔记

2012-11-13

sql-bench-insert-test ssd vs harddisk

Filed under: 技术话题 — hunter @ 5:42 pm

harddisk

Generating random keys
Creating tables
Inserting 10000 rows in order
Inserting 10000 rows in reverse order
Inserting 10000 rows in random order
Time for insert (30000): 1111 wallclock secs ( 1.51 usr  0.46 sys +  0.00 cusr  0.00 csys =  1.97 CPU)
Testing update of keys with functions
Time for update_of_key (5000):  110 wallclock secs ( 0.17 usr  0.06 sys +  0.00 cusr  0.00 csys =  0.23 CPU)
Time for update_of_key_big (480): 41 wallclock secs ( 0.03 usr  0.01 sys +  0.00 cusr  0.00 csys =  0.04 CPU)

Testing update with key
Time for update_with_key (30000):  773 wallclock secs ( 1.18 usr  0.41 sys +  0.00 cusr  0.00 csys =  1.59 CPU)
Time for update_with_key_prefix (10000):  240 wallclock secs ( 0.79 usr  0.16 sys +  0.00 cusr  0.00 csys =  0.95 CPU)
(more…)

测试Mysql 使用 SSD硬盘

Filed under: 技术话题 — hunter @ 5:36 pm

最近SSD硬盘价格大幅下跌,128G只需要500 (http://item.51buy.com/item-265823.html),已经达到心理价位了。

SSD硬盘的优势是随机读写速度高于传统硬盘(传统硬盘的优势是顺序读写),最大的缺点是写次数有限制,所以在配置mysql时,需要把binlog与datadir分离:

其中/data目录是传统硬盘,放binlog

/data2是SSD硬盘

[mysqld]
datadir=/data2/mysql
basedir=/usr/local/mysql
log-bin=/data/applog/mysql/mysql-bin

log-slow-queries=/data/applog/mysql/slow.log

innodb_data_home_dir = /data2/mysql
innodb_data_file_path = ibdata1:200M;ibdata2:100M:autoextend
innodb_log_group_home_dir= /data/applog/mysql/
(more…)

« Newer Posts

Powered by WordPress