Mailinglist Archive: opensuse (2441 mails)

< Previous Next >
Re: [SLE] How big of Swap file do you need?
  • From: David SMITH <dave.smith@xxxxxx>
  • Date: Thu, 9 Jun 2005 11:59:35 +0100
  • Message-id: <20050609105935.GP20185@xxxxxxxxxxxxxx>
On Wed, Jun 08, 2005 at 11:20:53AM -0500, BOB HERZOG wrote:
> I have a LSI Raid card with three 160 gb drives doing raid 5. The
> default swap is 1 gb do I need to up this default setting? What is the
> swap file used for?

MHO...

It depends on how much RAM you've got, and how much virtual memory you
need (i.e. how much total RAM + swap you think you'll need to run all
your processes).

I would suggest somewhere between 0.5 x RAM and 1.5 x RAM. If you have
too little, then the kernel will be forced to use physical RAM for stuff
which is used very infrequently and would therefore be a waste, as it
could be being used as disk cache.

If you are regularly using as much swap as you have RAM, you should be
buying more RAM, not increasing your swap (unless you are severely
budget-constrained, or your processes are such that they are happy to
be swapped out most of the time). The 2 x RAM rule-of-thumb is less
relevant nowadays.

BTW, some people here have mentioned to me that there is a problem with
Linux' performance with large amounts of swap (in particular, >2 GB).
We have some Opterons with 16 GB RAM, but I'm told that Linux won't
support individual swapfiles > 2 GB, and that if you add lots of 2 GB
swapfiles, the performance drops off massively. Has anyone seen this?
We're using RHEL, but I guess the problem would be seen on SuSE as well.

--
David Smith Work Email: Dave.Smith@xxxxxx
STMicroelectronics Home Email: David.Smith@xxxxxxxxxxxxxxxxxxxx
Bristol, England GPG Key: 0xF13192F2

< Previous Next >
Follow Ups
References