Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Mar 1998 14:45:02 -0800 (PST)
From:      Doug White <dwhite@gdi.uoregon.edu>
To:        David K Phinney <dphinney@dowco.com>
Cc:        freebsd-questions@FreeBSD.ORG
Subject:   Re: System performance analysis with vmstat et al.
Message-ID:  <Pine.BSF.3.96.980312143445.17791R-100000@gdi.uoregon.edu>
In-Reply-To: <199803121849.KAA29840@lithium.dowco.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, 12 Mar 1998, David K Phinney wrote:

> Can anyone point me to a tutorial or documentation on how to evaluate
> a system's performance using vmstat/iostat/etc. Specifically, what
> are pages paged in/out, page reclaims, the `free list', and how
> do I tell if my system is requiring more RAM/faster disk bus/etc based
> on these values. For instance, is it normal to see a value of 200 under
> `pi', but 0 under `po'? What are page faults, anyway (something to do
> about a request for memory which is swapped out?)

Let me see if I can do an operating systems class in a reasonable sized
email message ;-)

Most modern operating systems (UNIX-oids and Wind-oids) handle memory in
sections called `pages'.  FreeBSD uses a page size of 4096 bytes; other
systems use different sizes.  By using pages, the system can avoid having
to load an entire program (or `process') into physical memory at once; it
has to load some at run-time, but after that unused pages can be `paged
out', or removed from memory, to make room for other processes.  As the
program reaches areas of it's image that aren't in memory, the memory
system `pages in' the needed pages from disk.  Paged out pages can either
be discarded entirely or be placed in a special area of the disk for later
retrieval, called `swap'.  This system is called `virutal memory'.  

The big thing to look at on VM systems is swap usage, viewable in `top'
and `swapinfo' easier than in `systat -vmstat'.  If your machine has
constant disk activity and `top' shows lots of data going in/out of swap,
you need more memory to counteract the need for swap.  Swap will kill your
performance since a disk is several factors slower than RAM.  

Look for this line in the top display:

Swap: 100M Total, 37M Used, 63M Free, 37% Inuse, 144K In

If you see lots of In/Out and a high use percentage, consider buying some
SIMMs next time you're out shopping. 

In addition to helping swap usage, more RAM will allow the disk's buffer
cache to increase, saving you from disk accesses by grabbing them from
cache instead of directly from disk.

In terms of disk bandwidth, if your system serves lots of random requests
(like database or busy web pages) moving from IDE to SCSI may help you.
This is more of a judgement call on your part.  SCSI has the added benefit
of reducing CPU usage by offloading I/O operations onto the controller's
CPU.  (IDE requires the main CPU to do all the copying itself, which
really drags things out.)  

Doug White                              | University of Oregon  
Internet:  dwhite@resnet.uoregon.edu    | Residence Networking Assistant
http://gladstone.uoregon.edu/~dwhite    | Computer Science Major



To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.980312143445.17791R-100000>