我正在使用一个来自主机提供商的VPS。我的VPS有6个核心。在过去的几周里,我通常在任何时间点使用4-6个核心.我的网页加载速度非常快(大约2-4秒)。但是今天突然间(一整天),我的CPU使用量只有不到2秒,而我的页面加载时间通常是10秒左右。所以现在我很困惑,不知道我的服务器发生了什么。
我的猜测是,其他用户滥用服务器,耗尽所有内核,所以我的CPU使用率很少超过2(而我的配额是6)。
所以我的问题是:从我的VPS中,我可以检查承载我VPS的机器的资源使用情况(CPU)吗?
非常感谢。
发布于 2014-01-03 15:49:28
vmstat实用程序可以向您提供有关您的CPU的使用统计数据的报告。有一个CPU可能处于的状态列表,这个片段来自命令页:
us: Time spent running non-kernel code. (user time, including nice time)
sy: Time spent running kernel code. (system time)
id: Time spent idle. Prior to Linux 2.5.41, this includes IO-wait time.
wa: Time spent waiting for IO. Prior to Linux 2.5.41, included in idle.
st: Time stolen from a virtual machine. Prior to Linux 2.6.11, unknown.最后一个是对你来说应该重要的是,CPU花在另一个虚拟机上的时间比你的多。
使用vmstat的语法是vmstat [options] [delay [count]]。例如,vmstat 3 10将为您提供10行输出,每一行大约是前3秒。有关更多细节,请查看man 8 vmstat。
这个文章很好地解释了被偷的时间。
https://serverfault.com/questions/564880
复制相似问题