*BSD News Article 48123


Return to BSD News archive

Path: sserve!euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!simtel!news.sprintlink.net!howland.reston.ans.net!EU.net!Belgium.EU.net!news
From: Danny Backx <u27113@kb.be>
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: How many swap for FreeBSD ??
Date: 31 Jul 1995 14:37:13 GMT
Organization: Kredietbank, Havenlaan 2, B-1210 Brussel, Belgium
Lines: 36
Message-ID: <3vipqp$suj@news.Belgium.EU.net>
References: <3v84si$8n0@news.ust.hk> <3vh3oj$q0v@blob.best.net>
NNTP-Posting-Host: s854803.kb.be
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.04 9000/806)
To: dillon@best.com,ee_fai@uxmail.ust.hk
X-URL: news:3vh3oj$q0v@blob.best.net

dillon@best.com (Matt Dillon) wrote:
>    The rule of thumb is to put twice as much swap in as you have
>    real memory, but I have found from experience that putting four times
>    the swap as real memory is better... I can often fill up a 2x swap
>    long before the machine would otherwise thrash itself to death.  Also,
>    running out of memory+swap is a very bad thing, so you definitely want
>    to err on the side of caution and put more swap in then you think you
>    need.

The 2*RAM rule is a lot of crap !

The amount of swap space you put allows you to run more applications
at the same time. Add up all the memory requirements of all apps you
run simultaneously. This number should always be less than the total
swap space. Otherwise some app will get errors when it tries to allocate
more memory.

The amount of RAM you have just determines how fast processes run. If you
have less RAM than the working sets of all your apps together, then the
system will start paging. The more RAM, the less paging, and therefore,
the faster your system will be. Unless of course you have so much RAM
that no paging ever occurs. Then adding RAM doesn't do a thing.

As you see from the above there is no relationship between the two.

So how do you determine #swap space ? Check out what you run at the same
time. Especially look at compiles - compilers are very memory hungry,
and are real hogs if you put the optimizer on.

There is no fixed answer to how much you should set the swap space to.
Try it for yourself. If you find you allocated too much you might want
to repartition your disk. But then again large disks are cheap these
days.

	Danny