mysql 5.0与5.1性能测试对比
虚拟机,2cpu,1.5G内存
mysql 测试:
mysql MySQL 5.0.77 X86_64:
[root@mysqltest sql-bench]# ./run-all-tests –user=’root’ –password=’xxxxxx’
Benchmark DBD suite: 2.15
Date of test: 2010-01-07 14:09:15
Running tests on: Linux 2.6.18-164.9.1.el5 x86_64
Arguments:
Comments:
Limits from:
Server version: MySQL 5.0.77/
Optimization: None
Hardware:
alter-table: Total time: 29 wallclock secs ( 0.04 usr 0.03 sys + 0.00 cusr 0.00 csys = 0.07 CPU)
ATIS: Total time: 8 wallclock secs ( 2.55 usr 0.24 sys + 0.00 cusr 0.00 csys = 2.79 CPU)
big-tables: Total time: 8 wallclock secs ( 1.30 usr 0.23 sys + 0.00 cusr 0.00 csys = 1.53 CPU)
connect: Total time: 80 wallclock secs (16.38 usr 13.74 sys + 0.00 cusr 0.00 csys = 30.12 CPU)
create: Total time: 606 wallclock secs ( 2.26 usr 1.55 sys + 0.00 cusr 0.00 csys = 3.81 CPU)
insert: Total time: 1047 wallclock secs (165.57 usr 52.63 sys + 0.00 cusr 0.00 csys = 218.20 CPU)
select: Total time: 65 wallclock secs (15.76 usr 3.41 sys + 0.00 cusr 0.00 csys = 19.17 CPU)
transactions: Test skipped because the database doesn’t support transactions
wisconsin: Total time: 19 wallclock secs ( 1.54 usr 0.24 sys + 0.00 cusr 0.00 csys = 1.78 CPU)
All 9 test executed successfully
MySQL 5.1.42 community X86_64:
[root@mysqltest sql-bench]# ./run-all-tests –user=’root’ –password=’xxxxxx’
Benchmark DBD suite: 2.15
Date of test: 2010-01-07 16:35:57
Running tests on: Linux 2.6.18-164.9.1.el5 x86_64
Arguments:
Comments:
Limits from:
Server version: MySQL 5.1.42 community
Optimization: None
Hardware:
alter-table: Total time: 29 wallclock secs ( 0.03 usr 0.05 sys + 0.00 cusr 0.00 csys = 0.08 CPU)
ATIS: Total time: 8 wallclock secs ( 2.61 usr 0.26 sys + 0.00 cusr 0.00 csys = 2.87 CPU)
big-tables: Total time: 8 wallclock secs ( 1.30 usr 0.27 sys + 0.00 cusr 0.00 csys = 1.57 CPU)
connect: Total time: 83 wallclock secs (16.56 usr 15.81 sys + 0.00 cusr 0.00 csys = 32.37 CPU)
create: Total time: 633 wallclock secs ( 2.07 usr 2.05 sys + 0.00 cusr 0.00 csys = 4.12 CPU)
insert: Total time: 1106 wallclock secs (165.61 usr 62.38 sys + 0.00 cusr 0.00 csys = 227.99 CPU)
select: Total time: 63 wallclock secs (15.12 usr 3.63 sys + 0.00 cusr 0.00 csys = 18.75 CPU)
transactions: Test skipped because the database doesn’t support transactions
wisconsin: Total time: 20 wallclock secs ( 1.54 usr 0.29 sys + 0.00 cusr 0.00 csys = 1.83 CPU)
All 9 test executed successfully
/etc/my.cnf:
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Default to using old password format for compatibility with mysql 3.x
# clients (those using the mysqlclient10 compatibility package).
old_passwords=1
default-character-set = utf8
default-collation = utf8_general_ci
default-storage-engine=INNODB
skip-name-resolve
skip-locking
key_buffer = 64M
max_allowed_packet = 1M
table_cache = 102400
sort_buffer_size = 2M
read_buffer_size = 2M
read_rnd_buffer_size = 2M
myisam_sort_buffer_size = 16M
thread_cache_size = 8
query_cache_size = 16M
tmp_table_size = 256M
# Try number of CPU’s*2 for thread_concurrency
thread_concurrency = 4
lower_case_table_names = 1
max_connections = 500
#log-slow-queries=/var/log/mysql-slow-queries.log
#long_query_time = 1
wait_timeout = 86400
innodb_buffer_pool_size = 768M
innodb_additional_mem_pool_size = 128M
innodb_file_per_table
innodb_open_files = 102400
innodb_lock_wait_timeout = 50
innodb_log_file_size = 1G
innodb_log_buffer_size = 64M
transaction-isolation = READ-UNCOMMITTED
[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid
令人奇怪的是,5.1反而不如5.0快。