哪些文件占用了进程的大部分 I/O 时间?
我有一个相当大的 python 程序,导致大量磁盘 I/O(在 top
上,%wa
可以高达 80,而 iotop< /code> 说我的进程是罪魁祸首)。
有几件事可能会导致这一问题 - 我正在写入多个日志文件,并且我正在将缓存结果保存到磁盘的多个位置,因此我应该将注意力集中在哪里并不是很明显。
是否有 Linux 工具或 Python 技巧可以让我查看哪个子系统导致了最多的 I/O 操作?
I have a fairly large python program that is causing a lot of disk I/O (on top
, %wa
can get as high as 80, and iotop
says that my process is the culprit).
There are several things that may cause this - I'm writing to more than one log file, and I'm saving cached results to disk in several places, so it's not immediately obvious where I should focus my attention.
Is there a linux tool or a python trick that will allow me to see which subsystem is causing the most I/O operations?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
你应该看看 SystemTap。它是非常强大的 Linux 系统调用跟踪和分析机制:
http://sourceware.org/systemtap/wiki
我确信可以准确追踪到哪个文件描述符负责 IO 负载 - 但使用 systemtap 启动会变得复杂。
You should have a look at SystemTap. It's very powerful tracing and profiling mechanism for Linux system calls:
http://sourceware.org/systemtap/wiki
I'm sure it is possible to trace exactly which file descriptor is responsible for IO load - but it will get complicated to start with systemtap.