[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Swap space question



Years ago (well about two or three years ago) I worked as a sysadmin
in a university. Early implementations of swap required you to have
swap, because the kernel would always look for it to see if it was
swapped in. The swap had to be equivalent to or larger than your
physical ram.

I actually used to use much more swap space on old Sun systems 5x to
10x, and it would go into conniption fits from when we had too many
students log into the server. (At the time RAM was relatively
expensive, as were servers).

The newer kernels both Sparc and Linux (includian Debian Linux of
course), and I'm sure someone will correct me if I'm wrong, use very
sophisticated algorithms to use swap as additional memory instead of
simply keeping an image of memory in the swap space and paging the
frames into and out of RAM. So the newer kernels can use swap space
which is smaller than physical RAM. I could easily have 512M or RAM
and use 256M of swap and everything would work fine. It would be close
to having 768M of RAM except for a little overhead.

On Tue, May 02, 2000 at 04:37:46PM +1000, Michael Anthon wrote:
> > When I first installed Debian Sparc from the CD, I partitioned a Gig
> > of Swap space since I have half a Gig of Ram. The Slink kernel would

> 
> I have often seen this "rule of thumb" used in this way and I believe that
> it has long been misinterpreted.  The rule that I am talking about is "you
> need at least twice the amount of swap space as you have RAM".

Currently I have needed no swap and in face have yet to use more than
about 200M or RAM. [ I suspect that poorly written code and bugs in
some applications, or some applications on an SMP kernel are the only
reason I've used that much RAM.]


> 
> I am pretty sure that the original interpretation of this rule was more
> along the lines of "determine how much memory you will need to run
> everything you need to run, then make sure that at least 1/3 of that is
> physical RAM".
> 
> The intention here is a trade off between system performance and cost.
> Hardware has, however, progressed to a point where this rule is pretty much
> useless for normal systems.  If you are running a machine with 512M of RAM,

Systems with 512M of RAM are never normal systems and wont be until we
progress through four or five more generations of computers. (later
this week?). I will be using Squid and MySQL very heavily. The machine
is being configured as a proxy server, database server, and web
server. One of the joys of Squid is that it will keep as much in
memory as it can without triggering swap, if it is well
configured. This will mean that when I get a request for a web page
from the proxy server it should go out instantly instead of having to
be retrieved from the cache on disk. I haven't experimented much with
MySQL or SQUID in this environmented, so I'm making a lot of guesses.

> then you probably don't really need to configure any swap space at all
> unless the machine will need it for running a big database or some other
> memory hungry application.  That 1G of swap space could be used for a much
> better purpose (like storing 1G of pron or mp3s.. hehe).  If you ever really
> do need the extra memory, simple create a swap partition and use swapon as
> the need arises.
> 
> Just my $0.02 (+10%GST) worth.
> 
> Regards
> Michael Anthon
> 
> 
> --  
> To UNSUBSCRIBE, email to debian-sparc-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

-- 
Josh Kuperman                       
josh@saratoga.lib.ny.us


Reply to: