最新消息:

不要再执着于thread_concurrency

my.cnf admin 6256浏览 0评论

结论:
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多核处理能力,提高并发量

转载请注明:爱开源 » 不要再执着于thread_concurrency

您必须 登录 才能发表评论!