Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Feb 2007 15:35:41 -0800
From:      "pete wright" <nomadlogic@gmail.com>
To:        "Mark Jayson Alvarez" <markjayson.alvarez@gmail.com>
Cc:        questions@freebsd.org
Subject:   Re: interpreting "top" output (computing n% cpu usage in actual megahertz)
Message-ID:  <57d710000702021535j52da89e5m94cd01e57c1b177a@mail.gmail.com>
In-Reply-To: <cf5917110702012213o43ce8becw3a9cd54c2bb52281@mail.gmail.com>
References:  <cf5917110702012213o43ce8becw3a9cd54c2bb52281@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2/1/07, Mark Jayson Alvarez <markjayson.alvarez@gmail.com> wrote:
> Hi,
>
>
> My goal is to find out how much CPU a program consumes  when I execute it.
> In the manual, it says I  can toggle from "raw cpu" mode to "weighted cpu".
> However, I can't still understand the difference between the two and how it
> has something to
> do with my goal. Suppose my computer has a 1.6Ghz pentium 4 processor.
> I want to know how much is already in use or what percent. I also want to
> know how much it has increased
> when I run a particular program so that I can decide if this I can install
> this program without affecting other
> existing critical programs.

this link should be helpful regarding the cpu utilization:
http://students.cs.unipi.gr/pub/docs/sysadmin-1992-1998/html/v07/i05/a7.htm

from the article:
"On AIX 4 systems, CPU% is computed by dividing the time the process
uses the CPU by the elapsed time of the process. For example, if a
process was started 60 minutes ago, and has so far used 60 seconds of
the CPU, then its CPU% is 1 2/3%. This is sometimes called the
"weighted CPU%"."

which i believe gives a rough idea of how a weighted cpu average is
calculated.  hopefully someone more familiar with bsd internals can
comment on how we arrive at this value.


> The same goes with memory usage.. "Free doesn't
> mean that that are all my
> memory left that is useable right?
> The "Description of Memory" section just says:
> Active: number of pages active
> Inactive: number of pages inactive
>
> and so on and so forth without telling what the heck does it mean when a
> page is inactive and just what does pages
> means..
>
> Buf, Free, Wired, Cache... don't know what are these either.. Perhaps I
> should consult wiki or google for this.
>

yea that might be a good place to start.  these are fairly common
terms used when talking about the state of memory in operating
systems.  another excellent source is this book:
http://www.amazon.com/Design-Implementation-FreeBSD-Operating-System/dp/0201702452

it's an excellent reference for any OS in my opinion, but is obviously
very pertinent to FreeBSD.

this URL may also be a decent place to start:
http://en.wikipedia.org/wiki/Memory_management

HTH
-pete

-- 
~~o0OO0o~~
Pete Wright
www.nycbug.org
NYC's *BSD User Group



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?57d710000702021535j52da89e5m94cd01e57c1b177a>