[mysql]不要再执着于thread_concurrency

jackxiang 2014-9-2 21:07 | |
[mysql]不要再执着于thread_concurrency
结论:
thread_concurrency 在GNU/Linux系统上没有用的。

不过很多LINUX自带的mysql包里面的配置文件都有thread_concurrency选项,
甚至Mysql官方源码里面的my-large.cnf my-innodb-heavy-4G.cnf里面也有。。
Xml代码  收藏代码

    # This permits the application TO give the threads system a hint FOR the  
    # desired NUMBER OF threads that should be run at the same TIME.  This  
    # VALUE ONLY makes sense ON systems that support the thread_concurrency()  
    # FUNCTION CALL (Sun Solaris, FOR example).  
    # You should try [NUMBER OF CPUs]*(2..4) FOR thread_concurrency  
    thread_concurrency = 8  
于是在网上就流传开了,在一些优化mysql配置的文章中,都说要把thread_concurrency设置为 CPU核数*2。

但是千万别上当,调整这个选项纯属浪费时间。
它只在Solaris < 9 的系统中有用。。。
而且从mysql5.6.1开始,这个选项就被废了。
http://bugs.mysql.com/bug.php?id=55001

INNODB:
innodb_thread_concurrency = 128
innodb_purge_threads = 32 # 5.6之后才支持大于1, 5.5上会自动变成1
# 默认设置为 0,表示不限制并发数,这里推荐设置为0,更好去发挥CPU多核处理能力,提高并发量


作者:jackxiang@向东博客 专注WEB应用 构架之美 --- 构架之美,在于尽态极妍 | 应用之美,在于药到病除
地址:http://jackxiang.com/post/7439/
版权所有。转载时必须以链接形式注明作者和原始出处及本声明!

评论列表
发表评论

昵称

网址

电邮

打开HTML 打开UBB 打开表情 隐藏 记住我 [登入] [注册]