Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 04 May 2010 11:32:03 +0200
From:      Ivan Voras <ivoras@freebsd.org>
To:        freebsd-questions@freebsd.org
Subject:   Re: User cpu time VS system cpu time
Message-ID:  <hropia$uu9$1@dough.gmane.org>
In-Reply-To: <w2vd4ac64921005030900t38fa793cmf6647ff1252dc606@mail.gmail.com>
References:  <w2vd4ac64921005030900t38fa793cmf6647ff1252dc606@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 05/03/10 18:00, cronfy wrote:
> Hello,
>
> I want to understand difference between user CPU time and system CPU
> time in system accounting.
>
> When some process uses many system CPU, does it really mean that
> process prouduces heavy load on server and takes up resources that
> could be used by other tasks instead? Or it only means that this
> process performs many waits for, say, I/O operations?

In contrast to Linux (luckily), IO wait in itself in FreeBSD does not 
count as CPU time. Linux's "iowait" state is supposedly defined as "idle 
but having outstanding IO requests" but judging from performance curves 
in some cases I think some polling is involved.

System time is time spent in the kernel - it is practically always the 
result of issuing kernel syscalls from userland processes. Whether it 
influences the overall performance of the system depends on what the 
processes are doing - if the machine has multiple CPU cores and the 
syscalls exercise those parts of the system that are parallelized then 
no, your process would not influence the rest of the system anymore than 
it would by using "user" time.

But keep in mind that "kernel time" is a broad category - while IO time 
in itself does not count as CPU time, file system operations for example 
do, because they really can be CPU intensive. And by using the file 
system in certain ways, you really can block other processes from using 
it with the performance they would get otherwise. You can find out at a 
glance approximately what the process is doing simply by monitoring the 
"top" line for the process.

There is one more thing - if the machine in question is a virtual 
machine, it is normal for the "system" time to, unfortunately, be 
significantly higher than it would be otherwise because of the nature of 
the emulation.





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?hropia$uu9$1>