- 论坛徽章:
- 0
|
看了官方的HA方案觉得DRBD+replication是比较可靠的,参考了精华里面的一篇文章,里面说到不少好东东,但是没有涉及到性能比较,不知道有没有同学和我一样对这种方案的性能很是不满。不知道是不是我哪里配置不对?
硬件环境:
Dell 2950 500G×2 RAID0 其中创建了一个VolGroup单独给DRBD用,4G mem Redhat as5
这样的机器两台
软件环境:
MySQL:5.1.26-rc-community
drbd:version: 8.2.6
HB:2.1.3
配置:
drbd.conf
global
{
usage-count no;
}
common
{
protocol C;
}
resource r0
{
device /dev/drbd0;
disk /dev/mapper/VolGroup00-LogVol02;
meta-disk internal;
syncer
{
rate 100M;
}
on drbd-db1
{
address 1.1.0.1:7789;
}
on db2-raid0
{
address 1.1.0.2:7789;
}
}
my.cnf
[mysqld]
datadir=/drbd/mysql
pid-file=/drbd/mysql/mysql.pid
log-bin
binlog-do-db=mysqlslap # input the database which should be replicated
binlog-ignore-db=mysql # input the database that should be ignored for replication
binlog-ignore-db=test
server-id=1
default-storage-engine=InnoDB
character-set-server=utf8
collation-server=utf8_general_ci
innodb_file_per_table
max_connections=1000
[mysql.server]
user=mysql
其中1.1.0.1和1.1.0.2是网线直连
测试数据:
全部使用的是InnoDB引擎
DRBD+MySQL:
mysqlslap -a --concurrency=50,100,200 --number-of-queries 10000 --debug-info --auto-generate-sql-load-type=write
Benchmark
Average number of seconds to run all queries: 27.835 seconds
Minimum number of seconds to run all queries: 27.835 seconds
Maximum number of seconds to run all queries: 27.835 seconds
Number of clients running queries: 50
Average number of queries per client: 200
Benchmark
Average number of seconds to run all queries: 27.719 seconds
Minimum number of seconds to run all queries: 27.719 seconds
Maximum number of seconds to run all queries: 27.719 seconds
Number of clients running queries: 100
Average number of queries per client: 100
Benchmark
Average number of seconds to run all queries: 27.088 seconds
Minimum number of seconds to run all queries: 27.088 seconds
Maximum number of seconds to run all queries: 27.088 seconds
Number of clients running queries: 200
Average number of queries per client: 50
User time 0.17, System time 0.47
Maximum resident set size 0, Integral resident set size 0
Non-physical pagefaults 2717, Physical pagefaults 0, Swaps 0
Blocks in 0 out 0, Messages in 0 out 0, Signals 0
Voluntary context switches 62779, Involuntary context switches 565
MySQL replication:
mysqlslap -a --concurrency=50,100,200 --number-of-queries 10000 --debug-info --auto-generate-sql-load-type=write
Benchmark
Average number of seconds to run all queries: 0.679 seconds
Minimum number of seconds to run all queries: 0.679 seconds
Maximum number of seconds to run all queries: 0.679 seconds
Number of clients running queries: 50
Average number of queries per client: 200
Benchmark
Average number of seconds to run all queries: 0.917 seconds
Minimum number of seconds to run all queries: 0.917 seconds
Maximum number of seconds to run all queries: 0.917 seconds
Number of clients running queries: 100
Average number of queries per client: 100
Benchmark
Average number of seconds to run all queries: 1.164 seconds
Minimum number of seconds to run all queries: 1.164 seconds
Maximum number of seconds to run all queries: 1.164 seconds
Number of clients running queries: 200
Average number of queries per client: 50
User time 0.13, System time 0.52
Maximum resident set size 0, Integral resident set size 0
Non-physical pagefaults 2653, Physical pagefaults 0, Swaps 0
Blocks in 0 out 0, Messages in 0 out 0, Signals 0
Voluntary context switches 60294, Involuntary context switches 5993
以上可以看出写性能似乎差别很大,大家看看有问题吗?欢迎给出建议和你的测试数据
读性能的比较似乎意义不大,应为mysqlslap自动生成的表没有index,而且select全是整个表数据的查询就是类似select × from t1之类的。不过估计性能也会差别比较大吧。 |
|