LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices

Reply
 
Search this Thread
Old 10-11-2005, 03:22 AM   #1
alesz
Member
 
Registered: Mar 2005
Distribution: FC5 on disk, Knoppix as LiveCD
Posts: 48

Rep: Reputation: 15
per process disk usage


My disk is bottle neck of my system too many times.

How could I see per-process disk usage (writing, reading, time spent for I/O for disk?)?
It can be a CLI or GUI program.
 
Old 10-11-2005, 08:32 PM   #2
freakyg
Member
 
Registered: Apr 2005
Distribution: LFS 5.0 and 6.1
Posts: 705

Rep: Reputation: 30
Re: per process disk usage

Quote:
Originally posted by alesz
My disk is bottle neck of my system too many times.
is DMA enabled?? try this
Code:
hdparm -Tt /dev/hdxx
 
Old 10-12-2005, 12:58 AM   #3
Emmanuel_uk
Senior Member
 
Registered: Nov 2004
Distribution: Mandriva mostly, vector 5.1, tried many.Suse gone from HD because bad Novell/Zinblows agreement
Posts: 1,604

Rep: Reputation: 47
there is a tutorial knocking around on iostat and vmstat about bottleneck,
it was in linuxjournal I think, it might even be on LQ
because if I remember well Jeremy wrote it.
Anyhow, iostat (and maybe vmstat) might be what you need

alesz if you google for it and it meet your need, why not put
the link back in this thread
 
Old 10-12-2005, 07:15 AM   #4
alesz
Member
 
Registered: Mar 2005
Distribution: FC5 on disk, Knoppix as LiveCD
Posts: 48

Original Poster
Rep: Reputation: 15
I did the hdparm test again, as also before posting the first post.

The test is 3x repeated for accurate results.
Code:
# hdparm -Tt /dev/hdb

/dev/hdb:
 Timing cached reads:   1848 MB in  2.00 seconds = 922.30 MB/sec
 Timing buffered disk reads:  102 MB in  3.05 seconds =  33.47 MB/sec

# hdparm -Tt /dev/hdb

/dev/hdb:
 Timing cached reads:   1872 MB in  2.00 seconds = 934.74 MB/sec
 Timing buffered disk reads:   94 MB in  3.02 seconds =  31.14 MB/sec
# hdparm -Tt /dev/hdb

/dev/hdb:
 Timing cached reads:   1856 MB in  2.00 seconds = 928.14 MB/sec
 Timing buffered disk reads:   88 MB in  3.02 seconds =  29.18 MB/sec
The DMA is enabled:
Code:
 
# hdparm -d /dev/hdb

/dev/hdb:
 using_dma    =  1 (on)
Could it be the filesystem (ext3?)? The swap is sometimes even empty when the bottle neck occurs.

I have a Fedora Core 4 system, which is mostly compiled against i386, but the kernel is compiled against i686.
Is it a kernel problem, disk problem or a configuration problem?

When more processes use the disk, the scheduling algorithm for disk access goes nuts and the response times are pretty bad. Is there a way to set per process disk or i/o priority?

Answer to Emmanuel_uk:
The article link about iostat is
http://www.linuxquestions.org/questi...icle&artid=532
Another good utility for i/o monitoring is sar: it displays %iowait per daily intervals every 10 minutes.

But I still can't see per process i/o usage.

Last edited by alesz; 10-12-2005 at 09:24 AM.
 
Old 10-26-2005, 04:47 AM   #5
Emmanuel_uk
Senior Member
 
Registered: Nov 2004
Distribution: Mandriva mostly, vector 5.1, tried many.Suse gone from HD because bad Novell/Zinblows agreement
Posts: 1,604

Rep: Reputation: 47
lsof /dev/hda
or
lsof -p process id

Combined with bash + awk + grep + ls
If you sum the relevant file size

it should give you the total disk usage per process

Can you please post the script here if you go that way.
I am sure people will comment / help / improve / test it

regards
 
Old 12-03-2010, 11:02 PM   #6
avangel
LQ Newbie
 
Registered: Dec 2010
Distribution: Arch
Posts: 6

Rep: Reputation: 1
iotop

This thread seems to be quite old, but with no meaningful answer.
iotop seems to be the right tool.
For ubuntu you can install it by 'sudo apt-get install iotop'.
I found it by the 3rd google hit for "linux disk usage by process":
http : // reviewhubs . com /linuxtips/2009/06/iotop-howto-find-disk-usage-of-each.html
I put spaces to the url so that I can post this message.
 
Old 12-04-2010, 12:00 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,118

Rep: Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985Reputation: 985
Welcome to LQ - but you'll find yourself unpopular waking up "dead" threads.

Iotop relies on taskstats - which wasn't merged into the mainline kernel until 2007. Hence was/is irrelevant to a 2005 thread.
Search LQ and you will find several threads on iotop.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to get %CPU usage of a process devershetty Linux - Newbie 1 08-18-2008 01:52 AM
How to get %CPU usage of a process devershetty Linux - Newbie 13 08-16-2008 11:51 AM
How do I know processor usage by a process bipinkdas Linux - Newbie 1 11-04-2005 11:45 PM
Process memory usage wombat53 Linux - Newbie 5 07-21-2005 07:42 PM
CPU usage of a process asharma Solaris / OpenSolaris 7 03-29-2003 02:17 PM


All times are GMT -5. The time now is 02:27 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration