What process is writing to disk?


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users What process is writing to disk?
# 1  
Old 10-29-2008
Question What process is writing to disk?

What program can I use to determine what process is writing to disk?

I've got a Linux server and iostat reports something is writing to the system drive:
Code:
Device:         rrqm/s   wrqm/s   r/s   w/s   rsec/s   wsec/s avgrq-sz avgqu-sz    await  svctm  %util
sda               0.00   169.83  1.75 273.82   141.65  3465.34    13.09    69.29  263.50   2.23  61.42
sda               0.00   252.50  0.00 228.25     0.00   3526.00    15.45    53.86  204.70   2.50  56.95

Unfortunately lsof gives me no serious clue:
Code:
lsof +d / | awk '$4 ~ /[0-9].*[uw]/' # search for all files noted to be open for writing/updating.

The result is : ssh-agent, samba (/etc/samba/secrets.tdb - 8k file) and another log file in /tmp which is clearly idle.

Oh, and swap is empty.

Last edited by otheus; 10-29-2008 at 06:35 AM.. Reason: it's not swap
# 2  
Old 10-29-2008
I suppose that high IO activity means high system call rate and, dipending on IO subsystem, high IO waits. Did you try to run lsof passing the pids of the top top processes ?
I believe fuser could give some clue too.
# 3  
Old 10-29-2008
Try all these commands,
lsof
top
fuser

- nilesh
# 4  
Old 10-29-2008
Thanks, radoulov, but I don't see a way for top to display "high system call rate" or "high I/O rates" anything like that.

fuser is helping, to some extent, but I have no idea how to parse the ACCESS field when using -v. That might give me some clue. Is there any way to see writes-per-second on a per process basis?
# 5  
Old 10-29-2008
what does vmtstat 1 5 give you?
# 6  
Old 10-29-2008
Quote:
Originally Posted by otheus
Thanks, radoulov, but I don't see a way for top to display "high system call rate" or "high I/O rates" anything like that.
[...]
Sorry for not being clear, I meant high CPU usage (due to the high system call rate).

You may try iostat -d -p to see I/O activity by partition and thus restrict the possibilities.

Quote:
Is there any way to see writes-per-second on a per process basis?
Well,
the first think that I would begin with starcing the top CPU consumers to see where the CPU cycles go.

Last edited by radoulov; 10-29-2008 at 05:22 PM..
# 7  
Old 10-29-2008
Code:
$ vmstat 1 5
procs -----------memory---------- ---swap-- -----io---- --system-- -----cpu------
 r  b   swpd   free   buff  cache   si   so    bi    bo   in   cs us sy id wa st
 0  2    136 850584 148660 2616060    0    0   183   143    3    4  9  2 71 17  0
 0  4    136 854368 148816 2616112    0    0   192  2396 2401 1259  0  2 40 58  0
 0  2    136 854740 148876 2616876    0    0     0   736 2056 2842  4  1 50 46  0
 0  3    136 1733284 148944 1738972    0    0   140  1756 2152 3567  0  6 49 45  0
 0  3    136 1717312 149052 1755468    0    0  8244   740 2188 3970  0  2 44 54  0

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Open Source

Help with writing Shell Script to automate process using multiple commands

Hello! Need help to write a Linux script that can be run from windows using command/Cygwin/any other way. I am new to scripting, actually i am trying to automate server health check like free disk space, memory along with few services status, if any services is not running then start services ,... (7 Replies)
Discussion started by: Sayed Ibrahim
7 Replies

2. Emergency UNIX and Linux Support

How to find which process using, while getting High Disk I/O?

In Our Production server I/O was very high, I Recived mail that Disk I/O was high, is it possible how to find which process Used this much I/O ? Iam Using Ubuntu server 12.04. Linux 3.9.3-x86_64-server33 (Li473-1200) 07/23/2014 _x86_64_ (8 CPU) 12:05:01 AM DEV ... (5 Replies)
Discussion started by: babinlonston
5 Replies

3. Ubuntu

Reading disk usage per process

Hi, I am using iostat and /proc/<pid>/status to determine the disk usage per process. I have a question regarding buffer cache. When I am reading a 10MB file, the counters I get show that <5MB of the file is read. Do the counters in iostat and /proc/<pid> reflect the amount of data that is... (2 Replies)
Discussion started by: fidelity
2 Replies

4. UNIX for Dummies Questions & Answers

Writing a loop to process multiple input files by a shell script

I have multiple input files that I want to manipulate using a shell script. The files are called 250.1 through 250.1000 but I only want the script to manipulate 250.300 through 250.1000. Before I was using the following script to manipulate the text files: for i in 250.*; do || awk... (4 Replies)
Discussion started by: evelibertine
4 Replies

5. Linux

How to follow up disk mirroring process?

Hi, The OS is SuSE Enterprise 11 and the system is HP WS460c G6 Blade with hardware disk array RAID 1 mirror. One disk was just replaced and the disk mirroring process is on its way. My question is how to follow up / monitor the disk mirroring process? I know hpacucli can do the job, but there... (0 Replies)
Discussion started by: aixlover
0 Replies

6. UNIX for Dummies Questions & Answers

Which process is doing all the writing

Hi We are running an IBM P570 with AIX and Unidata. The disk monitor in nmon is showing that one of our logical volumes is hitting 100% most of the time, and that 98% of it is write. I am trying to identify the top processes in terms of disk IO, obviously particularly write so that we... (4 Replies)
Discussion started by: idwalton72
4 Replies

7. Shell Programming and Scripting

Which Process is writing this Log file!!

Hello , Well I have some /tmp files which are growing very quickly..Can anyone suggest me a way to find which process is logging into this file :confused: ? Thanks very much in Advance!! Mohammed (2 Replies)
Discussion started by: Mohammed
2 Replies

8. AIX

disk i/o per process on aix 5.2

hi, i am working on aix 5.2, i want to check disk i/o for any running process. please if anybody can help me. thanks Aqeel Anwar (1 Reply)
Discussion started by: system-admin
1 Replies

9. UNIX for Advanced & Expert Users

disk i/o per process

Dear All, We are using AIX 5.2 with IBM pseries servers. I want to check disk io for a running process. Please if anybody can help me. Thanks. Aqeel Anwar (1 Reply)
Discussion started by: aqeelcu@hotmail
1 Replies

10. UNIX for Dummies Questions & Answers

Writing file to disk takes time

Hi All, I am working on a Solaris machine. When i use a particular software to generate some files, the log shows around 0 to 3 secs for generating each file. But the same when i see on the disk it shows double the time difference between two file generation. For example if file A takes 0 secs... (7 Replies)
Discussion started by: nileshkarania
7 Replies
Login or Register to Ask a Question