我在64位Gentoo Box上运行MySQL 5.1.62。
这个MySQL负载很重,但问题是它只使用服务器的一半内核:
Cpu0:84.0%us,13.0%sy,0.0%ni,0.0%id,0.0%wa,0.0%hi,3.0%si,0.0%st
Cpu1:62.4%us,34.7%sy,0.0%ni,3.0%id,0.0%wa,0.0%hi,0.0%si,0.0%st
Cpu2:68.3%us,26.7%sy,0.0%ni,5.0%id,0.0%wa,0.0%hi,0.0%si,0.0%st
Cpu3:72.3%us,3.0%sy,0.0%ni,22.8%id,2.0%wa,0.0%hi,0.0%si,0.0%st
Cpu4:0.0%us,0.0%sy,0.0%ni,100.0%id,0.0%wa,0.0%hi,0.0%si,0.0%st
Cpu5:0.0%us,0.0%sy,0.0%ni,100.0%id,0.0%wa,0.0%hi,0.0%si,0.0%st
Cpu6:0.0%us,0.0%sy,0.0%ni,0.0%id,0.0%wa,0.0%hi,0.0%si,0.0%st
Cpu7:0.0%us,0.0%sy,0.0%ni,0.0%id,0.0%wa,0.0%hi,0.0%si,0.0%st
这是一款双四核服务器,配备:Intel(R)Xeon(R)CPU E5606 @ 2.13GHz
知道如何使用所有核心吗?
感谢您的帮助;
加埃唐
答案 0 :(得分:2)
主意?是的,但你不会喜欢它。
许多内核不能自动使系统更快:它运行的工作负载需要易于并行化。
我怀疑你的情况是,你正在运行少量的并发查询,每个查询都是CPU密集型的。碰巧,每个人只会使用一个核心。
要检查,如果这是罪魁祸首,请手动启动8个并发的CPU密集型查询 - 应充分利用您的CPU。
答案 1 :(得分:0)
较新版本的MySQL或Percona增强型MySQL服务器可以更好地利用您的核心。但是,数据库服务器通过IO绑定是相当常见的。