以前曾写过两个性能测试博文,根这次的结果比,上次的结果真是太差了。
先说硬件,HP刀片,CPU: 1C * 8U * 2.33GHz,内存:16G。
软件: LINUX RHEL 5.5 64x, MySQL 5.5.* 64x, 数据库的innodb_buffer_pool_size配置为12G
内存表的最大内存用量也为
测试使用JDBC单条操作,数据库表的原数据量为1500万条。4个字段两个索引,都是普通类型。,
使用了MySQL的三种引挚,单独测4种操作3遍的结果如下:
===============Memory=================10 threads=========================
--select
mysql spend [20] second, query [131335] times, 6566 per/sec
mysql spend [20] second, query [124570] times, 6228 per/sec
mysql spend [20] second, query [123248] times, 6162 per/sec
--insert
mysql spend [20] second, query [293173] times, 14658 per/sec
mysql spend [20] second, query [279397] times, 13969 per/sec
mysql spend [20] second, query [276626] times, 13831 per/sec
--delete
mysql spend [20] second, query [504] times, 25 per/sec
mysql spend [20] second, query [463] times, 23 per/sec
mysql spend [20] second, query [484] times, 24 per/sec
--update
mysql spend [20] second, query [475] times, 23 per/sec
mysql spend [20] second, query [464] times, 23 per/sec
mysql spend [20] second, query [493] times, 24 per/sec
===============MyIsam=================10 threads=========================
--select
mysql spend [20] second, query [18468] times, 923 per/sec
mysql spend [20] second, query [21199] times, 1059 per/sec
mysql spend [20] second, query [22940] times, 1147 per/sec
mysql spend [20] second, query [6901] times, 345 per/sec
mysql spend [20] second, query [10724] times, 536 per/sec
mysql spend [20] second, query [14463] times, 723 per/sec
mysql spend [20] second, query [19883] times, 994 per/sec
--insert
mysql spend [20] second, query [151023] times, 7551 per/sec
mysql spend [20] second, query [161894] times, 8094 per/sec
mysql spend [20] second, query [214178] times, 10708 per/sec
mysql spend [20] second, query [235302] times, 11765 per/sec
--delete
mysql spend [20] second, query [3158] times, 157 per/sec
mysql spend [20] second, query [2371] times, 118 per/sec
mysql spend [20] second, query [3513] times, 175 per/sec
mysql spend [20] second, query [2889] times, 144 per/sec
mysql spend [20] second, query [2031] times, 101 per/sec
--update
mysql spend [20] second, query [721] times, 36 per/sec
mysql spend [20] second, query [871] times, 43 per/sec
mysql spend [20] second, query [1008] times, 50 per/sec
===============InnoDB=================10 threads=========================
--select
mysql spend [20] second, query [138954] times, 6947 per/sec
mysql spend [20] second, query [129678] times, 6483 per/sec
mysql spend [20] second, query [125353] times, 6267 per/sec
mysql spend [20] second, query [123843] times, 6192 per/sec
--insert
mysql spend [20] second, query [262555] times, 13127 per/sec
mysql spend [20] second, query [263808] times, 13190 per/sec
mysql spend [20] second, query [264065] times, 13203 per/sec
--delete
mysql spend [20] second, query [4512] times, 225 per/sec
mysql spend [20] second, query [4263] times, 213 per/sec
mysql spend [20] second, query [4857] times, 242 per/sec
--update
mysql spend [20] second, query [4261] times, 213 per/sec
mysql spend [20] second, query [4464] times, 223 per/sec
mysql spend [20] second, query [3285] times, 164 per/sec
可见数据库的增查除速度都不错,但删除和更新速度简值不能接受。
把innodb_flush_log_at_trx_commit = 1改为2后,插入更新速度提高了3倍以上,到700
写于此处做个记录。