如何知道一个Linux进程正在等待什么? [英] How do I tell what a Linux process is waiting for?

查看:308
本文介绍了如何知道一个Linux进程正在等待什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在追踪在Linux下调试的应用程序中的性能瓶颈的原因。所涉及的各种过程似乎花费了大量时间阻止I / O请求,我想知道是否有人知道任何Linux技巧,让您看到为什么某个进程被阻止/什么资源是等等在 / proc 中有什么有用的吗?

I'm trying to track down the cause of performance bottlenecks in an application I'm debugging under Linux. The various processes involved seem to spend a lot of their time blocking on I/O requests, and I was wondering if anybody knew any Linux tricks that let you see why a particular process is blocked/what resource it's waiting for? Is there anything useful in /proc for instance?

推荐答案

它是,您使用顶部来检查状态。那么你可以通过桁架或者strace 来运行它。这应该详细说明发生了什么。如果不可能,请钩住直到 gdb 。像 iostat 这样的工具一般可能会告诉你,发生了什么(例如,如果磁盘是瓶颈) 。

Whatever process it is, you use top to check the state. Then you could run it through truss or strace. That should detail what is going on. If that is not possible, hook it up to gdb. Tools like iostat might show you in general what is going on (e.g. if disk is bottleneck).

这篇关于如何知道一个Linux进程正在等待什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆