linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: Swap size for a machine with 2GB of memory
@ 2001-08-20  0:08 Andries.Brouwer
  2001-08-21 23:14 ` Kurt Garloff
  2001-08-24 12:45 ` Rogier Wolff
  0 siblings, 2 replies; 18+ messages in thread
From: Andries.Brouwer @ 2001-08-20  0:08 UTC (permalink / raw)
  To: ebiederm, esr, sct; +Cc: gars, linux-kernel

    From: ebiederm@xmission.com (Eric W. Biederman)
    Date:     19 Aug 2001 14:49:23 -0600

    "Eric S. Raymond" <esr@thyrsus.com> writes:

    > The Red Hat installation manual claims that the size of the
    > swap partition should be twice the size of physical memory,
    > but no more than 128MB.
    > 
    > Should I believe the above formula?

You give two statements. The 128 MB bound was claimed by Microsoft
and we screamed loudly that that was a lie - now it is claimed
by both SuSE and RedHat. Funny.
No, the bound is not 128 MB. See mkswap(8).

    With respect to swap partitions the current limit is about 64Gig.
    You can actually make a larger swap partition but the kernel on x86
    only uses 24 offset bits into that partition.  The 128MB partition
    existed but was removed long ago.

Long ago I wrote in mkswap(8) that the max on i386 is about 2 GiB.
I seem to recall that at some point in time the swap size in
bytes had to fit in a signed long, and indeed, 2.1.117 has
        if (p->max >= 0x7fffffffL/PAGE_SIZE ...
2.2.0pre9 changed this into
        if (p->max >= SWP_OFFSET(SWP_ENTRY(0,~0UL)))
deleting this restriction.
If it is no longer there, I suppose I should change mkswap.c.
Stephen, can you confirm?

Andries

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Swap size for a machine with 2GB of memory
  2001-08-20  0:08 Swap size for a machine with 2GB of memory Andries.Brouwer
@ 2001-08-21 23:14 ` Kurt Garloff
  2001-08-24 12:45 ` Rogier Wolff
  1 sibling, 0 replies; 18+ messages in thread
From: Kurt Garloff @ 2001-08-21 23:14 UTC (permalink / raw)
  To: Andries.Brouwer; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 675 bytes --]

On Mon, Aug 20, 2001 at 12:08:40AM +0000, Andries Brouwer wrote:
> You give two statements. The 128 MB bound was claimed by Microsoft
> and we screamed loudly that that was a lie - now it is claimed
> by both SuSE and RedHat. Funny.

Oops! 
I found /usr/share/doc/packages/yast2/README.partitioner
Embarassing; considering that YaST2 is newer then the end of this limit ...

If you found more of them, please tell me, so it gets fixed.

TiA!
-- 
Kurt Garloff  <garloff@suse.de>                          Eindhoven, NL
GPG key: See mail header, key servers         Linux kernel development
SuSE GmbH, Nuernberg, DE                                SCSI, Security

[-- Attachment #2: Type: application/pgp-signature, Size: 232 bytes --]

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Swap size for a machine with 2GB of memory
  2001-08-20  0:08 Swap size for a machine with 2GB of memory Andries.Brouwer
  2001-08-21 23:14 ` Kurt Garloff
@ 2001-08-24 12:45 ` Rogier Wolff
  1 sibling, 0 replies; 18+ messages in thread
From: Rogier Wolff @ 2001-08-24 12:45 UTC (permalink / raw)
  To: Andries.Brouwer; +Cc: ebiederm, esr, sct, gars, linux-kernel

Andries.Brouwer@cwi.nl wrote:
>     From: ebiederm@xmission.com (Eric W. Biederman)
>     Date:     19 Aug 2001 14:49:23 -0600
> 
>     "Eric S. Raymond" <esr@thyrsus.com> writes:
> 
>     > The Red Hat installation manual claims that the size of the
>     > swap partition should be twice the size of physical memory,
>     > but no more than 128MB.
>     > 
>     > Should I believe the above formula?
> 
> You give two statements. The 128 MB bound was claimed by Microsoft
> and we screamed loudly that that was a lie - now it is claimed
> by both SuSE and RedHat. Funny.
> No, the bound is not 128 MB. See mkswap(8).

I think that red hat means: 

	recoomended swap (machine) = min (128M, 2 * RAM(machine));

My personal recommendation is: 

	recoomended swap (machine) = 2 * RAM(machine);
           (unless you know what you're doing). 

I run three machines with 0Mb swap: I know what I'm doing. If you know
you're going to run VERY VERY large simulations which have sort of
linear memory access patterns, it may pay to have LOTS more swap than
normally recommended.

Also, You spend just a few percent on "recommended swap" in relation
to what you just spent on "RAM (machine)". So even if you're never
going to use it, it's still usefull.

				Roger. 

-- 
** R.E.Wolff@BitWizard.nl ** http://www.BitWizard.nl/ ** +31-15-2137555 **
*-- BitWizard writes Linux device drivers for any device you may have! --*
* There are old pilots, and there are bold pilots. 
* There are also old, bald pilots. 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: Swap size for a machine with 2GB of memory
  2001-08-20 17:42     ` Eric W. Biederman
@ 2001-08-20 23:09       ` Kevin Krieser
  0 siblings, 0 replies; 18+ messages in thread
From: Kevin Krieser @ 2001-08-20 23:09 UTC (permalink / raw)
  To: Eric W. Biederman, Kevin Krieser; +Cc: Linux Kernel List

I was just experimenting.  512MB is more than sufficient for my needs, I
just couldn't bypass the $130 (at the time) for the memory which took me to
512MB.

I've seen some later updates to the VM, but at the moment, the 2.4.8 kernel
is working well for me.  Better than the 2.4.6 kernel.

-----Original Message-----
From: eric@frodo.biederman.org [mailto:eric@frodo.biederman.org]On
Behalf Of Eric W. Biederman
Sent: Monday, August 20, 2001 12:43 PM
To: Kevin Krieser
Cc: Linux Kernel List
Subject: Re: Swap size for a machine with 2GB of memory

As long as you don't have problems where you can't run your program
multiple times in a row, 2.4 sounds like is is behaving correctly and
sanely.

> However, since my normal behavior is for swap to not be used, I will wait
a
> little bit for some of the VM updates to be tested.

Are you saying something is wrong?

> I don't have 2X RAM because when I installed my system, I only had 256MB
of
> RAM.

This is not a requirement but is a requirement to have swap > mem if
you are swapping heavily and want good performance.

Eric



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Swap size for a machine with 2GB of memory
  2001-08-20  0:05   ` Kevin Krieser
@ 2001-08-20 17:42     ` Eric W. Biederman
  2001-08-20 23:09       ` Kevin Krieser
  0 siblings, 1 reply; 18+ messages in thread
From: Eric W. Biederman @ 2001-08-20 17:42 UTC (permalink / raw)
  To: Kevin Krieser; +Cc: Linux Kernel List

"Kevin Krieser" <kkrieser_list@footballmail.com> writes:

> I was just experimenting on my personal Linux computer this weekend, which
> has 512MB of RAM and 700MB of swap.  I also have an unpatched 2.4.8 kernel
> installed.
> 
> I wrote a program that allocated 700MB of RAM and touched every page, then
> read it back in.  When finished, there remained 250+ meg of swap in use, but
> no corresponding free space in RAM, compared to before running my test
> program.  The expected behavior of the 2.4 kernels seemed to be followed,
> where many programs retained space in both RAM and swap.

This was even the behavior in 2.0, and 2.2.  2.4 can simply be more
aggressive about it.  What this sounds like is that, your program
pushed 250MB of other programs into swap.  The programs were the
reread into memory when it was done, and their location in swap was
remembered so that if they were ever pushed into swap again they could
just be dropped from memory, and not need to be written out.

As long as you don't have problems where you can't run your program
multiple times in a row, 2.4 sounds like is is behaving correctly and
sanely.

> However, since my normal behavior is for swap to not be used, I will wait a
> little bit for some of the VM updates to be tested.

Are you saying something is wrong?

> I don't have 2X RAM because when I installed my system, I only had 256MB of
> RAM.

This is not a requirement but is a requirement to have swap > mem if
you are swapping heavily and want good performance.  

Eric

^ permalink raw reply	[flat|nested] 18+ messages in thread

* RE: Swap size for a machine with 2GB of memory
  2001-08-19 20:49 ` Eric W. Biederman
  2001-08-19 21:15   ` Eric S. Raymond
@ 2001-08-20  0:05   ` Kevin Krieser
  2001-08-20 17:42     ` Eric W. Biederman
  1 sibling, 1 reply; 18+ messages in thread
From: Kevin Krieser @ 2001-08-20  0:05 UTC (permalink / raw)
  To: Linux Kernel List

I was just experimenting on my personal Linux computer this weekend, which
has 512MB of RAM and 700MB of swap.  I also have an unpatched 2.4.8 kernel
installed.

I wrote a program that allocated 700MB of RAM and touched every page, then
read it back in.  When finished, there remained 250+ meg of swap in use, but
no corresponding free space in RAM, compared to before running my test
program.  The expected behavior of the 2.4 kernels seemed to be followed,
where many programs retained space in both RAM and swap.

However, since my normal behavior is for swap to not be used, I will wait a
little bit for some of the VM updates to be tested.

I don't have 2X RAM because when I installed my system, I only had 256MB of
RAM.




^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Swap size for a machine with 2GB of memory
  2001-08-19 15:52   ` Steven Cole
@ 2001-08-19 22:16     ` Luigi Genoni
  0 siblings, 0 replies; 18+ messages in thread
From: Luigi Genoni @ 2001-08-19 22:16 UTC (permalink / raw)
  To: Steven Cole; +Cc: Eric S. Raymond, Linux Kernel List, gars

Yes, i changed this value.
But i also changed a lot of other #define with bigger values, because
of the eavy use of all HW resources my users were needing. (maximum number
of processes and so on...)

It has been funny.
First i installed via NFS the slackware-current for sparc (now obsoleted,
and developed at sourceforge as splackware),
then i upgraded the kernel, then i installed a new disk
to make the swap and so on...

The latest kernel i used before the 3500 was sended to other uses
was 2.4.7.

The worser kernel on that server was 2.4.5, absolutelly it had the worst
VM i ever saw on ultrasparc.

Luigi


On Sun, 19 Aug 2001, Steven Cole wrote:

> On Sunday 19 August 2001 01:29 pm, Luigi Genoni wrote:
> [snipped]
> > On my ultrasparc linux with 4 GByte of RAM running 2.4.X kernels,
> > I needed to add a 8 GB disk just for
> > swap (16 partitions of 512 MB each one).
> --------^^
> Just curious, in linux-2.4.9/include/linux/swap.h line 11, we have:
>
> #define MAX_SWAPFILES 8
>
> Did you change this to 16, or does this not matter anymore?
> This value is the same in 2.4.8-ac7.
>
> Steven
>


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Swap size for a machine with 2GB of memory
  2001-08-19 20:49 ` Eric W. Biederman
@ 2001-08-19 21:15   ` Eric S. Raymond
  2001-08-20  0:05   ` Kevin Krieser
  1 sibling, 0 replies; 18+ messages in thread
From: Eric S. Raymond @ 2001-08-19 21:15 UTC (permalink / raw)
  To: Eric W. Biederman; +Cc: Linux Kernel List, gars

Eric W. Biederman <ebiederm@xmission.com>:
> There is no magic formula for calculating the amount of swap space
> needed.  It really needs to be sized to the expected load on your box
> plus some.  If you seriously expect to be using swap,  have swapsize >
> memsize and figure the amount of virtual memory you have is swapsize.
> 
> With respect to swap partitions the current limit is about 64Gig.
> You can actually make a larger swap partition but the kernel on x86
> only uses 24 offset bits into that partition.  The 128MB partition
> existed but was removed long ago.

That's helpful, thanks.
-- 
		<a href="http://www.tuxedo.org/~esr/">Eric S. Raymond</a>

Never trust a man who praises compassion while pointing a gun at you.

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Swap size for a machine with 2GB of memory
  2001-08-19  6:42 Eric S. Raymond
                   ` (4 preceding siblings ...)
  2001-08-19 17:29 ` Luigi Genoni
@ 2001-08-19 20:49 ` Eric W. Biederman
  2001-08-19 21:15   ` Eric S. Raymond
  2001-08-20  0:05   ` Kevin Krieser
  5 siblings, 2 replies; 18+ messages in thread
From: Eric W. Biederman @ 2001-08-19 20:49 UTC (permalink / raw)
  To: esr; +Cc: Linux Kernel List, gars

"Eric S. Raymond" <esr@thyrsus.com> writes:

> The Red Hat installation manual claims that the size of the swap partition
> should be twice the size of physical memory, but no more than 128MB.
> 
> The screaming hotrod machine Gary Sandine and I built around the Tyan S2464
> has 2GB of physical memory.  Should I believe the above formula?  If not,
> is there a more correct one for calculating needed swap on machines with
> very large memory?

There is no magic formula for calculating the amount of swap space
needed.  It really needs to be sized to the expected load on your box
plus some.  If you seriously expect to be using swap,  have swapsize >
memsize and figure the amount of virtual memory you have is swapsize.

With respect to swap partitions the current limit is about 64Gig.
You can actually make a larger swap partition but the kernel on x86
only uses 24 offset bits into that partition.  The 128MB partition
existed but was removed long ago.

Eric

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Swap size for a machine with 2GB of memory
  2001-08-19  6:42 Eric S. Raymond
                   ` (3 preceding siblings ...)
  2001-08-19 14:39 ` Steven Cole
@ 2001-08-19 17:29 ` Luigi Genoni
  2001-08-19 15:52   ` Steven Cole
  2001-08-19 20:49 ` Eric W. Biederman
  5 siblings, 1 reply; 18+ messages in thread
From: Luigi Genoni @ 2001-08-19 17:29 UTC (permalink / raw)
  To: Eric S. Raymond; +Cc: Linux Kernel List, gars



On Sun, 19 Aug 2001, Eric S. Raymond wrote:

> The Red Hat installation manual claims that the size of the swap partition
> should be twice the size of physical memory, but no more than 128MB.
???
with old 2.0 kernels there was a limit to swap partition of 128MB each
one, and then you could use a lot of them if you have need of a lot of
swap.
 >
> The screaming hotrod machine Gary Sandine and I built around the Tyan S2464
> has 2GB of physical memory.  Should I believe the above formula?  If not,
> is there a more correct one for calculating needed swap on machines with
> very large memory?
Depends of what is your need. in general kernel 2.4 needs of more swap
space in front of 2.2. To explain why whould be long,
it's due to VM change and a different page aging. You can check in
a kml archive to find an explanetion in a better english than mine.

with early 2.4 kernel Linus suggested to have a swap area double in front
of the physical ram. That was expecially true for pc having big amount of
ram that are going to have long uptimes.

On my ultrasparc linux with 4 GByte of RAM running 2.4.X kernels,
I needed to add a 8 GB disk just for
swap (16 partitions of 512 MB each one).
But that is because i needed all that swap for what my users where running
on this server at the times. (now this sun 3500 has been sended to other
use, SOB!)

On the other side, if you are going to run some applications that do not
require a lot
of memory, it could happen that you will never touch the swap for more
that some Mbyte.

In generel it is a good thing to have an amount of swap bigger than your
physical ram, but not too mutch.
if you need a swap 4 times bigger than your physical ram that means you
should buy more ram.

bests
Luigi
>
> (No further hangs, BTW.)
> --
> 		<a href="http://www.tuxedo.org/~esr/">Eric S. Raymond</a>
>
> .. a government and its agents are under no general duty to
> provide public services, such as police protection, to any
> particular individual citizen...
>         -- Warren v. District of Columbia, 444 A.2d 1 (D.C. App.181)
> -


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Swap size for a machine with 2GB of memory
  2001-08-19 14:08 ` Alan Cox
@ 2001-08-19 16:48   ` Eric S. Raymond
  0 siblings, 0 replies; 18+ messages in thread
From: Eric S. Raymond @ 2001-08-19 16:48 UTC (permalink / raw)
  To: Alan Cox; +Cc: Linux Kernel List, gars

Alan Cox <alan@lxorguk.ukuu.org.uk>:
> Good that its no longer hung again - this is with noapic now ?

APIC is on.
-- 
		<a href="http://www.tuxedo.org/~esr/">Eric S. Raymond</a>

When only cops have guns, it's called a "police state".
        -- Claire Wolfe, "101 Things To Do Until The Revolution" 

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Swap size for a machine with 2GB of memory
  2001-08-19  9:46 ` Ignacio Vazquez-Abrams
@ 2001-08-19 16:15   ` Ingo Oeser
  0 siblings, 0 replies; 18+ messages in thread
From: Ingo Oeser @ 2001-08-19 16:15 UTC (permalink / raw)
  To: Ignacio Vazquez-Abrams; +Cc: Eric S. Raymond, Linux Kernel List, gars

On Sun, Aug 19, 2001 at 05:46:32AM -0400, Ignacio Vazquez-Abrams wrote:
> At the other extreme, I've heard of machines that are running heavy scientific
> applications. They have 4 GB of RAM and run with 10+ GB of swap.
> 
> A machine with 2 GB of RAM can easily live with no swap, unless you want to
> run web, proxy, or database servers in very large configurations, or if you
> compile software several times the size of XFree86 with any regularity. By
> "very large configurations" I mean something you would have to deliberately
> set, probably requiring a change to defined constants in the software.

One word here: tmpfs.

I use several amounts of RAM as tmpfs. And with that you can
certainly reach the point of swapping sth. out.

But my machine has only 1GB of RAM and I set up only 2GB of swap.

I compile and test many things there directly from the CVS, run
things like the fcgp to produce nearly a GB of PostScript files
and many more fun things.

So if you plan to use tmpfs, better have enough swap available.
Files in tmpfs can also not be removed by the OOM killer. So you
should define your tmpfs limits properly.

Regards

Ingo Oeser
-- 
Isn't vi that text editor with two modes... one that beeps and one
that corrupts your file? --- Dan Jacobson in comp.os.linux.advocacy

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Swap size for a machine with 2GB of memory
  2001-08-19 17:29 ` Luigi Genoni
@ 2001-08-19 15:52   ` Steven Cole
  2001-08-19 22:16     ` Luigi Genoni
  0 siblings, 1 reply; 18+ messages in thread
From: Steven Cole @ 2001-08-19 15:52 UTC (permalink / raw)
  To: Luigi Genoni, Eric S. Raymond; +Cc: Linux Kernel List, gars

On Sunday 19 August 2001 01:29 pm, Luigi Genoni wrote:
[snipped]
> On my ultrasparc linux with 4 GByte of RAM running 2.4.X kernels,
> I needed to add a 8 GB disk just for
> swap (16 partitions of 512 MB each one).
--------^^
Just curious, in linux-2.4.9/include/linux/swap.h line 11, we have:

#define MAX_SWAPFILES 8

Did you change this to 16, or does this not matter anymore?  
This value is the same in 2.4.8-ac7.

Steven

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Swap size for a machine with 2GB of memory
  2001-08-19  6:42 Eric S. Raymond
                   ` (2 preceding siblings ...)
  2001-08-19 14:08 ` Alan Cox
@ 2001-08-19 14:39 ` Steven Cole
  2001-08-19 17:29 ` Luigi Genoni
  2001-08-19 20:49 ` Eric W. Biederman
  5 siblings, 0 replies; 18+ messages in thread
From: Steven Cole @ 2001-08-19 14:39 UTC (permalink / raw)
  To: Eric S. Raymond, Linux Kernel List; +Cc: gars

On Sunday 19 August 2001 02:42 am, Eric S. Raymond wrote:
> The Red Hat installation manual claims that the size of the swap partition
> should be twice the size of physical memory, but no more than 128MB.
----------------------------------------------------------------^^^^^
For the benefit of anyone finding this in the kernel archives and any
future Linux technical historians, this 128MB swap partition limit was
fixed by a patch submitted by Stephen C. Tweedie on 9 Jul 1998, and which 
appeared in 2.1.109 on 20 Jul 1998.

Steven

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Swap size for a machine with 2GB of memory
  2001-08-19  6:42 Eric S. Raymond
  2001-08-19  8:25 ` Andrzej Krzysztofowicz
  2001-08-19  9:46 ` Ignacio Vazquez-Abrams
@ 2001-08-19 14:08 ` Alan Cox
  2001-08-19 16:48   ` Eric S. Raymond
  2001-08-19 14:39 ` Steven Cole
                   ` (2 subsequent siblings)
  5 siblings, 1 reply; 18+ messages in thread
From: Alan Cox @ 2001-08-19 14:08 UTC (permalink / raw)
  To: esr; +Cc: Linux Kernel List, gars

> The screaming hotrod machine Gary Sandine and I built around the Tyan S2464
> has 2GB of physical memory.  Should I believe the above formula?  If not,

The formula is sort of true for 2.4 due to VM issues, its no longer true
for 2.4-ac because Rik fixed the weakness in question, and it wont matter
if you are not running >2Gb of toys anyway

Good that its no longer hung again - this is with noapic now ?

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Swap size for a machine with 2GB of memory
  2001-08-19  6:42 Eric S. Raymond
  2001-08-19  8:25 ` Andrzej Krzysztofowicz
@ 2001-08-19  9:46 ` Ignacio Vazquez-Abrams
  2001-08-19 16:15   ` Ingo Oeser
  2001-08-19 14:08 ` Alan Cox
                   ` (3 subsequent siblings)
  5 siblings, 1 reply; 18+ messages in thread
From: Ignacio Vazquez-Abrams @ 2001-08-19  9:46 UTC (permalink / raw)
  To: Eric S. Raymond; +Cc: Linux Kernel List, gars

On Sun, 19 Aug 2001, Eric S. Raymond wrote:

> The Red Hat installation manual claims that the size of the swap partition
> should be twice the size of physical memory, but no more than 128MB.
>
> The screaming hotrod machine Gary Sandine and I built around the Tyan S2464
> has 2GB of physical memory.  Should I believe the above formula?  If not,
> is there a more correct one for calculating needed swap on machines with
> very large memory?
>
> (No further hangs, BTW.)

I'm not an authority on swap under Linux, but I can tell you about my personal
experiences, and I hope it helps you.

In reality, machines with as little as 192 MB of RAM don't necessarily need
swap space. Of course, it depends on what you're doing with it. A machine like
that would be used solely as a high-powered office machine or a low-grade
workstation.

At the other extreme, I've heard of machines that are running heavy scientific
applications. They have 4 GB of RAM and run with 10+ GB of swap.

A machine with 2 GB of RAM can easily live with no swap, unless you want to
run web, proxy, or database servers in very large configurations, or if you
compile software several times the size of XFree86 with any regularity. By
"very large configurations" I mean something you would have to deliberately
set, probably requiring a change to defined constants in the software.

-- 
Ignacio Vazquez-Abrams  <ignacio@openservices.net>



^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: Swap size for a machine with 2GB of memory
  2001-08-19  6:42 Eric S. Raymond
@ 2001-08-19  8:25 ` Andrzej Krzysztofowicz
  2001-08-19  9:46 ` Ignacio Vazquez-Abrams
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 18+ messages in thread
From: Andrzej Krzysztofowicz @ 2001-08-19  8:25 UTC (permalink / raw)
  To: kufel!thyrsus.com!esr; +Cc: Linux Kernel List, kufel!lanm-pc.com!gars

> 
> The Red Hat installation manual claims that the size of the swap partition
> should be twice the size of physical memory, but no more than 128MB.

This manual is outdated. 

1. You hahe 2GB limit for a single swap file/partition now. And you can use
   many of them.
2. it sjould be <= 2* RAM, i.e. 0 <= SWAP <= 2*RAM. More is inefficient.
3. except kernels 2.4.x, where x <= 7-ac8, where you should have SWAP=0 or
   SWAP > RAM. 2.4.7-ac9 & 2.4.8 have already this problem fixed.

> The screaming hotrod machine Gary Sandine and I built around the Tyan S2464
> has 2GB of physical memory.  Should I believe the above formula?  If not,
> is there a more correct one for calculating needed swap on machines with
> very large memory?

Correct and universal formula for swap size is as always:
   SWAP = MAX_RAM_you_ever_need - physical_RAM_you_have

However in 2.4 more eficient (and in 2.40-7 obligatory) is:
   SWAP = MAX_RAM_you_ever_need > physical_RAM_you_have
          ? MAX_RAM_you_ever_need
;)

Andrzej

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Swap size for a machine with 2GB of memory
@ 2001-08-19  6:42 Eric S. Raymond
  2001-08-19  8:25 ` Andrzej Krzysztofowicz
                   ` (5 more replies)
  0 siblings, 6 replies; 18+ messages in thread
From: Eric S. Raymond @ 2001-08-19  6:42 UTC (permalink / raw)
  To: Linux Kernel List; +Cc: gars

The Red Hat installation manual claims that the size of the swap partition
should be twice the size of physical memory, but no more than 128MB.

The screaming hotrod machine Gary Sandine and I built around the Tyan S2464
has 2GB of physical memory.  Should I believe the above formula?  If not,
is there a more correct one for calculating needed swap on machines with
very large memory?

(No further hangs, BTW.)
-- 
		<a href="http://www.tuxedo.org/~esr/">Eric S. Raymond</a>

.. a government and its agents are under no general duty to 
provide public services, such as police protection, to any 
particular individual citizen...
        -- Warren v. District of Columbia, 444 A.2d 1 (D.C. App.181)

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2001-08-24 12:45 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-20  0:08 Swap size for a machine with 2GB of memory Andries.Brouwer
2001-08-21 23:14 ` Kurt Garloff
2001-08-24 12:45 ` Rogier Wolff
  -- strict thread matches above, loose matches on Subject: below --
2001-08-19  6:42 Eric S. Raymond
2001-08-19  8:25 ` Andrzej Krzysztofowicz
2001-08-19  9:46 ` Ignacio Vazquez-Abrams
2001-08-19 16:15   ` Ingo Oeser
2001-08-19 14:08 ` Alan Cox
2001-08-19 16:48   ` Eric S. Raymond
2001-08-19 14:39 ` Steven Cole
2001-08-19 17:29 ` Luigi Genoni
2001-08-19 15:52   ` Steven Cole
2001-08-19 22:16     ` Luigi Genoni
2001-08-19 20:49 ` Eric W. Biederman
2001-08-19 21:15   ` Eric S. Raymond
2001-08-20  0:05   ` Kevin Krieser
2001-08-20 17:42     ` Eric W. Biederman
2001-08-20 23:09       ` Kevin Krieser

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).