[Gllug] Swap Restrictions

Steve Nelson sanelson at gmail.com
Wed Apr 12 08:35:12 UTC 2006


Hello All,

I was always under the impression that on x86 architecture there is a
2G limit of size of swap areas.  I read this in the mkswap manual
page:

""" The  maximum  useful  size of a swap area depends on the
architecture and kernel version.  It is roughly 2GiB on i386, PPC,
m68k, ARM, 1GiB on sparc, 512MiB on mips, 128GiB on alpha and 3TiB on
sparc64. For kernels after 2.3.3 there is no that limitation."""

I had wondered if this still applied, given the "after 2.3.3" statement.

However,  I have a machine here where someone has created a 4G swap
file, only 2G of which is used:

[root at s3td-a1]~# grep -i swap /proc/meminfo
Swap: 2147467264 32415744 2115051520
SwapCached:      31656 kB
SwapTotal:     2097136 kB
SwapFree:      2065480 kB
[root at s3td-a1]~# fdisk -l /dev/cciss/c0d0 | grep swap
/dev/cciss/c0d0p7         14544     16599   8388464   82  Linux swap

I was asked yesterday to build a machine again with 4G of swap. 
Incidentally, this reminds me of discussion of whether one would want
this much swap (there is 2G of RAM in the machine) - I the suggestion
recently being that 1x physical RAM is ample.  Anyway, I decided to
create 2 x 2G swap partitions, which seems to have worked:

[root at l380k-ha-q]~# grep -i swap /proc/meminfo
Swap: 4294852608        0 4294852608
SwapCached:          0 kB
SwapTotal:     4194192 kB
SwapFree:      4194192 kB
[root at l380k-ha-q]~# fdisk -l | grep swap
/dev/cciss/c0d0p6          6965      7478   2097104   82  Linux swap
/dev/cciss/c0d0p7          7479      7992   2097104   82  Linux swap

So do I take it that the 2G limit is still in place?  If so how should
we read the 2.3.3 comment in the man page?

Finally, I have just built another two machines, both with 8G of RAM. 
The client requested 16G of swap(!).  There weren't enough partitions
to make 8 x 2G partitions, and surely this is overkill anyway, even
for a very very busy Oracle server?  I created 3 x 2G.  Just wondered
what we think about such large swap partitions, and how they should be
created?  More extended partitions and multiples of 2G?

Thanks,

S.
-- 
Gllug mailing list  -  Gllug at gllug.org.uk
http://lists.gllug.org.uk/mailman/listinfo/gllug




More information about the GLLUG mailing list