1

我在 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

知道如何使用所有内核吗?

谢谢你的帮助;

盖坦

4

2 回答 2

2

主意?是的,但你不会喜欢它。

许多内核不会自动使系统更快:它运行的工作负载需要易于并行化。

我怀疑在您的情况下发生的是,您正在运行少量并发查询,每个查询都是 CPU 密集型的。碰巧的是,每个都只会使用一个核心。

要检查这是否是罪魁祸首,请手动启动 8 个并发的 CPU 密集型查询 - 您的 CPU 应该被充分使用。

于 2012-07-05T23:31:28.163 回答
0

较新版本的 MySQL 或Percona增强型 MySQL 服务器可能会更好地利用您的内核。不过,数据库服务器受 IO 限制是相当普遍的。

于 2012-07-05T23:50:54.257 回答