[nycbug-talk] Memory sizing

Marc Spitzer mspitzer at gmail.com
Sat Apr 22 20:27:50 EDT 2006

On 4/22/06, Francisco Reyes <lists at stringsutils.com> wrote:
> Charles Sprickman writes:
> > Another resource (besides this fine list) is the Postgresql-performance
> > list.
> I am familiar with that list. I am subscribed to it.
> However I am trying to learn from the FreeBSD side first.. how to read
> the memory portion of "top" and whatever other tool there is to figure
> memory status.

here is a nice explanation of the memory description, from tops man page:

       Mem:  9220K  Active, 1032K Inact, 3284K Wired, 1MB Cache, 2M Buf, 1320K
       Free Swap:   91M Total, 79M Free, 13% Inuse, 80K In, 104 K Out

       K: Kilobyte

       M:     Megabyte

       %:     1/100

              number of pages active

       Inact: number of pages inactive

       Wired: number of pages wired down, including cached file data pages

       Cache: number of pages used for VM-level disk caching

       Buf:   number of pages used for BIO-level disk caching

       Free:  number of pages free

       Total: total available swap usage

       Free:  total free swap usage

       Inuse: swap usage

       In:    pages paged in from swap devices (last interval)

       Out:   pages paged out to swap devices (last interval)

what needs more explanation, other then Wired which I am not too sure
about?  pstat, vmstat and things pointed to in their man pages might
also be of interest also look at thing that end in stat, some may be

[marc at laptop ~]$ ls {/sbin/,/bin/,/usr/bin/,/usr/sbin/}*stat
ls: /bin/*stat: No such file or directory
/sbin/ipfstat           /usr/bin/stat           /usr/sbin/iostat
/sbin/kldstat           /usr/bin/systat         /usr/sbin/pmcstat
/usr/bin/btsockstat     /usr/bin/uustat         /usr/sbin/pstat
/usr/bin/fstat          /usr/bin/vmstat         /usr/sbin/purgestat
/usr/bin/netstat        /usr/sbin/gstat         /usr/sbin/slstat
/usr/bin/nfsstat        /usr/sbin/hoststat
/usr/bin/sockstat       /usr/sbin/ifmcstat
[marc at laptop ~]$

and some will not, slstat for examle.

Also put a $value on an hour of your time.  so you do not spend $1000
on researching a $200 question.  I just looked at pricewatch.com and
memory is cheap enough that you should just buy lots and be done, 2gb
stick is running around $140-175.

> Only one of the two machines I will be ordering soon will be a DB server.

this is definatly a $200 question, assuming there are 4 slots
available just get 2 of the bigest sticks that fit and buy 2 more if
it is not big enough. Or just fill it with the argument is it worth X
to run the risk of memory being a problem.


"We trained very hard, but it seemed that every time we were beginning to
form into teams we would be reorganized. I was to learn later in life that
we tend to meet any new situation by reorganizing, and a wonderful method it
can be for creating the illusion of progress, while producing confusion,
inefficiency and demoralization."
-Gaius Petronius, 1st Century AD

More information about the talk mailing list