Script to find Disk utilized processes.
I have written a script that triggers a mail if the server load average goes beyond a specific value.
The mail contains following field Current Load average. Top 10 CPU utilized processes. Code:
ps -auxf | sort -nr -k 3 | head -10 Code:
ps -auxf | sort -nr -k 4 | head -10 Is there any way of finding top 10 processes for Disk related activity? |
Code:
iotop -b -n1 -o -P -qqq | head -n 10 |
Quote:
|
Most major distributions have it available for installation. You can also get it here.
|
iotop Taskstats requires taskstats to be:
a) available in the kernel, and b) enabled. If the distro doesn't ship iostats, it's likely they don't (yet) have a kernel that supports it. Try a later release of the distro. I have grave concerns about using loadavg as a trigger like this in Linux. It's quite common to see high loadavg with little or no CPU usage and little (or no) I/O. But, it's Linux - the choice is yours. |
Quote:
|
iotop works great.
It was not installed by default, but I used yum to get it and I love it. @pinga123: which distro do you use, and doesn't it have iotop in its repository? |
Quote:
Code:
# lsb_release -a Code:
# rpm -ivh python-ctypes-1.0.2-2.el5.i386.rpm |
iotop is in the sysstat package.
Edit: correction. iostat is in the sysstat package. iotop is all by itself in the Ubuntu (my system's) repository. |
is iotop and iostat does the same? I dont have iostat too is there easier way to enable it?
edited: Enabled iostat by installing sysstat package. Does iostat tells which process is causing high io utilization. by simply giving iostat results in total read/write on every disk. |
I am guessing you are using redhat 5.2 from your kernel name.
I did a bit of googling, andhere is what I found: The EPEL repository could be what you need to get the iotop rpm: http://www.cyberciti.biz/faq/rhel-fe...ble-epel-repo/ http://download.fedora.redhat.com/pu...r_i.group.html |
Quote:
Code:
# iotop |
to check your kernel version, can you post output of:
Code:
uname -a |
Quote:
|
(just noticed this thread again).
As I stated above, you must be on a kernel that has taskstats support. At 2.6.18, no (userspace) tool can provide the data as it doesn't exist. Upgrade is the only answer. |
All times are GMT -5. The time now is 07:53 PM. |