From owner-freebsd-questions@FreeBSD.ORG Tue May 4 09:32:05 2010 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id AF424106566B for ; Tue, 4 May 2010 09:32:05 +0000 (UTC) (envelope-from freebsd-questions@m.gmane.org) Received: from lo.gmane.org (lo.gmane.org [80.91.229.12]) by mx1.freebsd.org (Postfix) with ESMTP id 3C72F8FC16 for ; Tue, 4 May 2010 09:32:05 +0000 (UTC) Received: from list by lo.gmane.org with local (Exim 4.69) (envelope-from ) id 1O9ETz-0006zH-R2 for freebsd-questions@freebsd.org; Tue, 04 May 2010 11:32:03 +0200 Received: from lara.cc.fer.hr ([161.53.72.113]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 May 2010 11:32:03 +0200 Received: from ivoras by lara.cc.fer.hr with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 04 May 2010 11:32:03 +0200 X-Injected-Via-Gmane: http://gmane.org/ To: freebsd-questions@freebsd.org connect(): No such file or directory From: Ivan Voras Date: Tue, 04 May 2010 11:32:03 +0200 Lines: 37 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Complaints-To: usenet@dough.gmane.org X-Gmane-NNTP-Posting-Host: lara.cc.fer.hr User-Agent: Mozilla/5.0 (X11; U; FreeBSD amd64; en-US; rv:1.9.1.8) Gecko/20100329 Thunderbird/3.0.3 In-Reply-To: X-Enigmail-Version: 1.0.1 Subject: Re: User cpu time VS system cpu time X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 04 May 2010 09:32:05 -0000 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.