阿里巴巴DBA,原去哪儿网DBA。专注于MySQL源码研究、DBA运维、CGroup虚拟化及Linux Kernel源码研究等。 github:https://github.com/HengWang/ Email:king_wangheng@163.com 微博 :@王恒-Henry QQ :506437736
分类: Mysql/postgreSQL
2012-04-27 12:11:30
参数设置
其他参数的设置为:
innodb_additional_mem_pool_size =256 innodb_log_buffer_size = 512M innodb_buffer_pool_size = 32G innodb_max_dirty_pages_pct=75 innodb_log_file_size=4G |
测试结果及分析
测试innodb_thread_concurrency分别为0、16、32时,percona server的性能。
(1)innodb_thread_concurrency为0情况下得出的TPmC结果:
[transaction percentage] Payment: 43.48% (>=43.0%) [OK] Order-Status: 4.35% (>= 4.0%) [OK] Delivery: 4.35% (>= 4.0%) [OK] Stock-Level: 4.35% (>= 4.0%) [OK] [response time (at least 90% passed)] New-Order: 100.00% [OK] Payment: 100.00% [OK] Order-Status: 100.00% [OK] Delivery: 100.00% [OK] Stock-Level: 100.00% [OK]
19751.566 TpmC |
性能分析如图:
(2)innodb_thread_concurrency为16情况下得出的TPmC结果:
[transaction percentage] Payment: 43.48% (>=43.0%) [OK] Order-Status: 4.35% (>= 4.0%) [OK] Delivery: 4.35% (>= 4.0%) [OK] Stock-Level: 4.35% (>= 4.0%) [OK] [response time (at least 90% passed)] New-Order: 100.00% [OK] Payment: 100.00% [OK] Order-Status: 100.00% [OK] Delivery: 100.00% [OK] Stock-Level: 100.00% [OK]
19176.000 TpmC |
性能分析如图:
(3)innodb_thread_concurrency为32情况下得出的TPmC结果:
[transaction percentage] Payment: 43.48% (>=43.0%) [OK] Order-Status: 4.35% (>= 4.0%) [OK] Delivery: 4.35% (>= 4.0%) [OK] Stock-Level: 4.35% (>= 4.0%) [OK] [response time (at least 90% passed)] New-Order: 100.00% [OK] Payment: 100.00% [OK] Order-Status: 100.00% [OK] Delivery: 100.00% [OK] Stock-Level: 100.00% [OK]
19569.199 TpmC |
性能分析如图:
测试结论
从以上测试可知,innodb_thread_concurrency为默认值0时,性能优于设置的值为16、32时的性能。默认值0表示不限制线程数,而当线程数不断增加时,性能也会降低,会浪费大量的时间用于线程间的切换。在并发数不大的情况下,该值可以采用默认值,而当并发数较大时,该值根据系统配置,需要更完备的测试。