TCMalloc 是用于优化C++写的多线程应用,比glibc 2.3的malloc快。详细说明请看TCMalloc:线程缓存的Malloc。这里我只测试它对mysql的影响到底有多少;从测试结果来看,数据量较小时,采用TCMalloc还是值得的,但是数据量较大之后,貌似反而更差了。本次测试采用sysbench工具,实际表现还是放到真正运行环境中才能知晓了。
表记录数
|
prepare
|
transaction/s
|
r/w request/s
|
other/s
|
total time
|
|
100w
|
17.524
|
2071.5
|
39358.47
|
4143
|
4.8274
|
malloc
|
16.015
|
2182.41
|
41465.73
|
4364.81
|
4.5821
|
tcmalloc
|
|
|
||||||
500w
|
1m30.819
|
1865.3
|
35440.75
|
3730.61
|
5.3611
|
|
1m23.496
|
1915.09
|
36386.74
|
3830.18
|
5.2217
|
||
1000w
|
3m7.059
|
1239.32
|
23547.15
|
2478.65
|
8.0689
|
|
2m54.832
|
1881.11
|
35741.08
|
3762.22
|
5.316
|
||
5000w
|
15m57.269
|
403.65
|
7669.44
|
807.31
|
123.8683
|
|
15m17.735
|
392.3
|
7453.66
|
784.6
|
127.4541
|
||
1亿
|
|
468.56
|
8902.7
|
937.13
|
106.7092
|
|
|
452.12
|
8590.31
|
904.24
|
110.5897
|