From owner-freebsd-questions Thu Mar 12 14:46:04 1998 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id OAA17316 for freebsd-questions-outgoing; Thu, 12 Mar 1998 14:46:04 -0800 (PST) (envelope-from owner-freebsd-questions@FreeBSD.ORG) Received: from gdi.uoregon.edu (gdi.uoregon.edu [128.223.170.30]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id OAA17166 for ; Thu, 12 Mar 1998 14:45:22 -0800 (PST) (envelope-from dwhite@gdi.uoregon.edu) Received: from localhost (dwhite@localhost) by gdi.uoregon.edu (8.8.7/8.8.8) with SMTP id OAA17891; Thu, 12 Mar 1998 14:45:02 -0800 (PST) (envelope-from dwhite@gdi.uoregon.edu) Date: Thu, 12 Mar 1998 14:45:02 -0800 (PST) From: Doug White Reply-To: Doug White To: David K Phinney cc: freebsd-questions@FreeBSD.ORG Subject: Re: System performance analysis with vmstat et al. In-Reply-To: <199803121849.KAA29840@lithium.dowco.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG 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