This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(7)
您正在寻找 iotop(假设您有内核 >2.6.20 和 Python 2.5)。 如果做不到这一点,您将考虑挂钩文件系统。 我推荐前者。
You're looking for
iotop
(assuming you've got kernel >2.6.20 and Python 2.5). Failing that, you're looking into hooking into the filesystem. I recommend the former.要找出当前正在运行哪些处于状态“D”(等待磁盘响应)的进程:
while true; 约会; 辅助 | awk '{if($8=="D") print $0;}'; 睡觉1; done
或
watch -n1 -d "ps axu | awk '{if (\$8==\"D\") {print \$0}}'"
如您所见结果,jdb2/dm-0-8(ext4 日志进程)和 kdmflush 不断阻塞您的 Linux。
有关更多详细信息,此 URL 可能会有所帮助:Linux 等待-IO问题
To find out which processes in state 'D' (waiting for disk response) are currently running:
while true; do date; ps aux | awk '{if($8=="D") print $0;}'; sleep 1; done
or
watch -n1 -d "ps axu | awk '{if (\$8==\"D\") {print \$0}}'"
As you can see from the result, the jdb2/dm-0-8 (ext4 journal process), and kdmflush are constantly block your Linux.
For more details this URL could be helpful: Linux Wait-IO Problem
atop 也能很好地工作,即使在无法运行 iotop 的旧 CentOS 5.x 系统上也可以轻松安装。 按
d
显示磁盘详细信息,?
寻求帮助。这清楚地表明 java pid 9862 是罪魁祸首。
atop also works well and installs easily even on older CentOS 5.x systems which can't run iotop. Hit
d
to show disk details,?
for help.This clearly shows java pid 9862 is the culprit.
TL;DR
如果您可以使用 iotop,请使用。 否则这可能会有所帮助。
使用
top
,然后使用这些快捷方式:这必须显示值
> 1.0 wa
至少一个核心 - 如果没有磁盘等待,则根本没有 IO 负载,无需进一步查看。 重要的负载通常从> 开始。 15.0 瓦
。选择“S”,即进程状态列。 反转排序顺序,以便“R”(正在运行)进程显示在顶部。 如果您可以发现“D”进程(等待磁盘),您就可以知道罪魁祸首可能是什么。
TL;DR
If you can use
iotop
, do so. Else this might help.Use
top
, then use these shortcuts:This has to show values
> 1.0 wa
for at least one core - if there are no diskwaits, there is simply no IO load and no need to look further. Significant loads usually start> 15.0 wa
.Chose 'S', the process status column. Reverse the sort order so the 'R' (running) processes are shown on top. If you can spot 'D' processes (waiting for disk), you have an indicator what your culprit might be.
带有 -a 标志的 iotop:
iotop with the -a flag:
对于 KDE 用户,您可以使用“ctrl-esc”顶部调用系统活动监视器,其中包含带有进程 ID 和名称的 I/O 活动图表。
由于“新用户状态”,我无权上传图片,但您可以查看下面的图片。 它有一个IO读写栏。
(来源:kde.org)
For KDE Users you can use 'ctrl-esc' top call up a system actrivity monitor and there is I/O activities charts with process id and name.
I don't have permissions to upload image, due to 'new user status' but you can check out the image below. It has a column for IO read and write.
(source: kde.org)
您是否考虑过 lsof(列出打开的文件)?
Have you considered
lsof
(list open files)?