When I do ps -ef, I see "TIME" field. What does this field mean? From what I understand, this tells the actual CPU time, that the process got (amidst all the context switching). Does the TIME field include the disk read/write time also or only the CPU time?
Linux – The TIME field in ps -ef
administrationlinuxprocesspstop
Related Solutions
hi
is the time spent processing hardware interrupts. Hardware interrupts are generated by hardware devices (network cards, keyboard controller, external timer, hardware sensors, ...) when they need to signal something to the CPU (data has arrived, for example).
Since these can happen very frequently, and since they essentially block the current CPU while they are running, kernel hardware interrupt handlers are written to be as fast and simple as possible.
If long or complex processing needs to be done, these tasks are deferred using a mechanism call softirqs
. These are scheduled independently, can run on any CPU, can even run concurrently (none of that is true of hardware interrupt handlers).
The part about hard IRQs blocking the current CPU, and the part about softirqs
being able to run anywhere are not exactly correct, there can be limitations, and some hard IRQs can interrupt others.
As an example, a "data received" hardware interrupt from a network card could simply store the information "card ethX needs to be serviced" somewhere and schedule a softirq
. The softirq
would be the thing that triggers the actual packet routing.
si
represents the time spent in these softirqs
.
A good read about the softirq
mechanism (with a bit of history too) is Matthew Wilcox's I'll Do It Later: Softirqs, Tasklets, Bottom Halves, Task Queues,
Work Queues and Timers (PDF, 64k).
st
, "steal time", is only relevant in virtualized environments. It represents time when the real CPU was not available to the current virtual machine — it was "stolen" from that VM by the hypervisor (either to run another VM, or for its own needs).
The CPU time accounting document from IBM has more information about steal time, and CPU accounting in virtualized environments. (It's aimed at zSeries type hardware, but the general idea is the same for most platforms.)
Its right there in the man
page:
pstree shows running processes as a tree. The tree is rooted at either pid or init
if pid is omitted. If a user name is specified, all process trees rooted at pro-
cesses owned by that user are shown.
pstree visually merges identical branches by putting them in square brackets and
prefixing them with the repetition count, e.g.
init-+-getty
|-getty
|-getty
‘-getty
becomes
init---4*[getty]
Child threads of a process are found under the parent process and are shown with
the process name in curly braces, e.g.
icecast2---13*[{icecast2}]
In your case, the process 27108 was started by the script Script.sh
. The Script.sh
created a java
process which spawned another 15 java threads.
A ps -eLf | grep java | wc -l
should returned you a count around the number 15.
Best Answer
It's the execution time - the time the process actually used the CPU(s), this does not count in the time the process waits for I/O events.