interpreting "top" output (computing n% cpu usage in actual
nomadlogic at gmail.com
Fri Feb 2 23:35:49 UTC 2007
On 2/1/07, Mark Jayson Alvarez <markjayson.alvarez at gmail.com> wrote:
> 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:
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
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
> 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:
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:
NYC's *BSD User Group
More information about the freebsd-questions