From owner-freebsd-hackers Wed Dec 20 17:08:46 1995 Return-Path: owner-hackers Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id RAA27556 for hackers-outgoing; Wed, 20 Dec 1995 17:08:46 -0800 (PST) Received: from hemi.com (hemi.com [204.132.158.10]) by freefall.freebsd.org (8.7.3/8.7.3) with SMTP id RAA27551 for ; Wed, 20 Dec 1995 17:08:36 -0800 (PST) Received: (from mbarkah@localhost) by hemi.com (8.6.11/8.6.9) id SAA10030; Wed, 20 Dec 1995 18:08:20 -0700 From: Ade Barkah Message-Id: <199512210108.SAA10030@hemi.com> Subject: Re: Need more memory? To: joe@ns.via.net (Joe McGuckin) Date: Wed, 20 Dec 1995 18:08:20 -0700 (MST) Cc: hackers@freebsd.org In-Reply-To: <199512202125.NAA07272@ns.via.net> from "Joe McGuckin" at Dec 20, 95 01:25:31 pm X-Mailer: ELM [version 2.4 PL24] Content-Type: text Sender: owner-hackers@freebsd.org Precedence: bulk > What is a good indication of when you need to add ram. The best indicator might be to monitor the `vmstat' utility. The two parameters to glance at are "avm" (active virtual pages) and "fre" (the size of the free list.) The avm is how much "virtual memory" your processes are using. Since some memory is shared, others can be swapped out, etc., the avm can be larger than the amount of real physical memory you have without adversely affecting performance. A rule of thumb is you're doing well when avm is less than twice your physical memory, but for a typical workstation the avm can be much larger than the physical memory and you'd still be ok. This is especially true if you're running something like X-windows. The "fre" parameter gives you a more direct (absolute) hint of how much physical memory is left free. If the free list gets real low all the time, then maybe it's time to add memory. When memory is low (as shown by huge avm and low fre), then you can see how badly you're doing by the paging activity parameters in vmstat, the "fr", "po" and "sr" parameters (and perhaps "de"). "fr" is the amount of pages freed per second. Since pages are always freed by normal activities, you'll always see some fr activity so it's less interesting normally. "sr" shows the amount of pages scanned by the clock algorithm. Activity here means you're at the short end of the stick. Basically the system is actively searching for pages to be swapped out. "de" marks an artificially placed demand to help the system from trashing... it means you're past the deep end. =) When you think the system is starting to swap (sr shows activity) then check out "po" (pages paged out) and the swap space statistics. If po is really active then you're running out of memory fast. If po shows some tiny numbers once in a very long while, it's probably just vm "trash" and not a concern. You examine the swap space statistics by using the `pstat -T' command. It will show something like `0M/127M swap space' (meaning you're using 0 swap from the 127mb you reserved.) Again, a moderate number of processes swapped out is usually fine (these processes are probably idling anyway.) You can find out which processes are swapped out by using the `ps' command (the RSS of the process will be zero, and the process will have a "W" flag marked in its state.) On the other hand, if `pstat -T' shows your swap space if full, then you pick up the microphone and say, "Houston... we got a problem..." Running other cool programs like `top' periodically also helps you stay in front of demand. Some people run all these utilities (and some others like iostat and netstat) periodically from a script to maintain hourly statistics like whats kept by the sar/sag utilities in System V (I kinda miss those daily sag graphs.) Regards, -Ade Barkah -------------------------------------------------------------------- Inet: mbarkah@hemi.com - HEMISPHERE ONLINE - www: --------------------------------------------------------------------