Re: Swap space question

2000-05-05 Thread Josh Kuperman
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 [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

-- 
Josh Kuperman   
[EMAIL PROTECTED]


Re: Swap space question

2000-05-02 Thread Chad Miller
On Tue, May 02, 2000 at 04:37:46PM +1000, Michael Anthon wrote:
> 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".


IIRC, it's a BSDism.  On panics, the kernel shoves an image of itself 
into the swap.  One needs at least the amount of ram, plus some extra
wiggle-room, to do so.

I may be wrong.  No, really!  It is possible!

- chad

--
Chad Miller <[EMAIL PROTECTED]> URL: http://web.chad.org/
"Any technology distinguishable from magic is insufficiently advanced".
First corollary to Clarke's Third Law (Jargon File, v4.2.0, 'magic')


RE: Swap space question

2000-05-02 Thread Jason Gunthorpe

On Tue, 2 May 2000, Michael Anthon wrote:

> 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".

Actually, apparently, long ago, the amount of swap you had directly
equaled the amount of VM you had. RAM was just a cache for your swap. So
if you had alot of ram you needed at least that much swap behind it. From
there it is pretty reasonable to go for double that, back in that era.

Jason


Re: Swap space question

2000-05-02 Thread Sanjeev \"Ghane\" Gupta
At the risk of being an AOL user, me too.

The rule is "Make sure your real ram is at least a third of what you need",
not "You need three times what you have".

Regards,

- Original Message -
From: Michael Anthon <[EMAIL PROTECTED]>
To: 
Sent: Tuesday, May 02, 2000 2:37 PM
Subject: RE: Swap space question


> > 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".
>
> 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,
> 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 [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact
[EMAIL PROTECTED]
>
>


RE: Swap space question

2000-05-02 Thread Michael Anthon
> 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".

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,
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