mysql5.6 cpu多核_mysql利用CPU多核

今天感觉mysql数据库写入时有时会失败,感觉是性能上有点问题,发现CPU很快就占满了,通过查找资料,有如下这么一段话

I learned something surprising: In spite of the documentation, it is best to leave innodb_thread_concurrency at 0 (infinite concurrency). That way, InnoDB decides the best number of innodb_concurrecy_tickets to open for a given MySQL instance setup.

Once you set innodb_thread_concurrency to 0, you can set innodb_read_io_threads and innodb_write_io_threads (both since MySQL 5.1.38) to the maximum value of 64. This should engage more cores.

可以看出通过设置通过innodb_thread_concurrency,innodb_read_io_threads innodb_write_io_threads 来设置,innodb_thread_concurrency这个参数设置为0时,表示不限制线程数。innodb_read_io_threads innodb_write_io_threads这两个参数默认值是4,如果CPU是2颗8核的,那么可以设置为innodb_read_io_threads=8,innodb_write_io_threads=8,当然如果是读比写多的话。可以把读的参数设置大点。

通过设置完成,可以发现还是不错的。

原文:http://itsoar.blog.51cto.com/8915220/1594012

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值