[SLUG] LPI: Swap space size

Ian Eade webmaster at hammondgallery.co.uk
Wed Aug 17 20:44:30 BST 2005



-----Original Message-----
From: scarborough-bounces at mailman.lug.org.uk
[mailto:scarborough-bounces at mailman.lug.org.uk] On Behalf Of Martin Webb
Sent: 17 August 2005 12:27
To: Scarborough Linux User Group
Subject: Re: [SLUG] LPI: Swap space size

john at johnallsopp.co.uk wrote:

>I'm reading this in the HOWTOs about how much disc swap space to
>create and it makes no sense, can anyone shed any light on it?:
>  
>
The simplest and most honest answer to the question above is "No", I 
can't answer those intricacies at any more precise level: so why am I 
answering this query?
What I can suggest is that, when it comes to the time to answer the 
questions, the questions themselves cannot be too specific, because 
there are only rules of thumb (and there seem to be different sizes of 
thumb), and different uses.  I have seen:
- make your swap space the same size as RAM;
- make your swap space one and a half times the size of RAM;
- make your swap space twice the size of RAM.
The distributions I'm running at present make swap twice the size of RAM

(RAM 512MB, Swap 1024MB).
I envisage a question no more complex that: "You have 512MB of RAM, and 
you have several applications open, each using large amounts of memory.

What size swap file would you suggest for this configuration?"  To which

I would answer "Lots and lots, or 1536MB at most".
I think another important issue is that, if the PC seems to be slow, 
labouring, doing more swapping than actual work, then the swap file is 
too small.
I quite often look at the system monitor, and keep one open on one of 
the desktops.  It never shows more than a few k of swap used.  This 
seems wasteful of space on the disc, but with the size of today's discs,

a few percent of a meg against gigs of space doesn't matter much.  It's 
only going to be an issue if you're working with a 2 gig or less disc on

an old machine, and perhaps then there ought to be a well though out
answer.
I shall look forward to more precise answers.
Martin

-- 
================================

A few years back when PC's had 128MB or less of RAM then having a swap
file was vital, even though the RAM is mostly used when opening and
closing programs so having more RAM would allow you to open/close things
quicker but may not make any difference when the program was running.
The break to the rule is if your PC spec was bare minimum from the start
and you were using intensive programs, but what would you expect?

Nowadays every PC is expected to have 256MB of RAM upwards (current OS's
demand it) and the quality of the RAM and disc drives have improved so
the issues of a RAM disk is becoming less important. I have 1GB of DDR
RAM and have a total of 190MB of swap space, this number is not
calculated but merely what was left over when I split my disk into GB
portions. Unless I deliberately open loads of programs and perform loads
of intensive operations then I encounter no problems and the swap is
hardly ever used.

A rule of thumb I would follow would be:

RAM: 128MB
SWAP: 120MB
 
RAM: 256MB
SWAP: 250MB

RAM: 500MB
SWAP: 350MB

RAM: 1GBMB
SWAP: 200MB

You should also try and ensure that the swap is on a disk that is as
clean as possible so that it has not had any programs installed on it
and it is defragged etc.

Ian



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.300 / Virus Database: 267.10.7 - Release Date: 11/08/2005
 





More information about the Scarborough mailing list