What exactly is a wall clock, user processor, and system processor on UNIX?

I can guess based on the names, but what exactly is the wall time, user processor time, and system processor time on UNIX?

Is the user processor the time taken to execute the user code, and the kernel time — the processor — the time spent on the kernel due to the need for privileged operations (for example, IO to disk)?

In what unit of time is this measurement.

And is the wall time really the number of seconds spent on the processor, or is this name just misleading?

+93
unix operating-system
Sep 07 '11 at 14:50
source share
4 answers

The wall clock time is the time when the clock on the wall (or the stopwatch in the hand) will be measured as elapsed between the beginning of the process and "now."

User processor time and system processor time are, as you said, pretty much the amount of time spent on user code and the amount of time spent on kernel code.

Units are seconds (and subseconds, which can be microseconds or nanoseconds).

Wall clock time is not the number of seconds spent on the processor; This is the elapsed time, including the time spent waiting for it to be included in the CPU (while other processes are starting).

+98
Sep 07 2018-11-11T00:
source share

Wall time: time elapsed in accordance with the internal clock of the computer, which must correspond to the time in the outside world. This has nothing to do with CPU usage; This is for reference only.

CPU user time and system time: exactly what you think. System calls, which include I / O calls, such as read , write , etc., are made by going to the kernel code and doing this.

If the wall time is <CPU, then you are running a parallel program. If the wall clock is> processor time, you are waiting for a disk, network, or other devices.

All are measured in seconds, in SI .

+26
Sep 07 2018-11-11T00:
source share

The wall clock time is exactly what he says, the time elapsed taking into account the clock on your wall (or wristwatch)

User processor time is the time spent on the "user land", that is, the time spent on non-nuclear processes

The time in the system processor is the time spent on the kernel, usually the time spent on servicing system calls.

+6
Sep 07 2018-11-11T00:
source share
 time [WHAT-EVER-COMMAND] 



 real 7m2.444s user 76m14.607s sys 2m29.432s $ lscpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian CPU(s): 24 

real or wall clock

real 7m2.444s

On a 24-core system, this cmd / process took 7+ mins for this process. This is using the most possible parallelism with all given kernels.

user

user 76m14.607s

The cmd / process has used this processor time. In other words, on a machine with a single-core processor, the user is real and the user will be almost equal, so the same command will take ~ 76 minutes.

systemic

sys 2m29.432s

This is the time taken by the kernel to perform all the basic / system level operations to run this cmd, including context switching, resource allocation, etc.

Note. The example assumes your team is using concurrency / threads.

Detailed manual page: https://linux.die.net/man/1/time

+1
Mar 14 '18 at 3:35
source share



All Articles