How to monitor the running i/o statistics of an application
iomonitoring
In windows I find it incredibly useful to monitor total I/O read bytes to give myself an idea of how long a command line process is taking/will take to execute a task. For example, for capinfos:
How would I get this information in linux?
Best Answer
iotop let you monitor the I/O consumption of each running process :
sudo apt-get install iotop
sudo iotop -a
(-a option is to display accumulated I/O instead of bandwidth)
For example, if I want to monitor Firefox I will run :
The traditional, portable, commonly-used way is that the parent process watches over its children.
The basic primitives are the wait and waitpid system calls. When a child process dies, the parent process receives a SIGCHLD signal, telling it it should call wait to know which child died and its exit status. The parent process can instead choose to ignore SIGCHLD and call waitpid(-1, &status, WNOHANG) at its convenience.
To monitor many processes, you would either spawn them all from the same parent, or invoke them all through a simple monitoring process that just calls the desired program, waits for it to terminate and reports on the termination (in shell syntax: myprogram; echo myprogram $? >>/var/run/monitor-collector-pipe). If you're coming from the Windows world, note that having small programs doing one specialized task is a common design in the Unix world, the OS is designed to make processes cheap.
There are many process monitoring (also called supervisor) programs that can report when a process dies and optionally restart it and far more besides: Monit, Supervise, Upstart, …
Best Answer
iotop
let you monitor the I/O consumption of each running process :(
-a
option is to display accumulated I/O instead of bandwidth)For example, if I want to monitor Firefox I will run :
(Where
3120
is the PID of Firefox)