[Users] recommended swap space

Dariush Pietrzak ml-openvz-eyck at ddiary.eu
Thu Dec 6 13:36:29 EST 2007


> documentation says swap should be pyhsical RAM*2.
 This rule was created when HDD were many times faster compared to RAM then
they are today(and when programs needed way more virtual space in relation
to what could be available).
 Imagine how long it would take read/write 32G from HDD..., also, most
really large requirements for ram come from various layers of essentially
caching. In the 90s it was quite typical to run servers with half of
virtual space permanently swapped out ( 64M ram machine, with 128M swap,
and never less then 64M swap used, 512M machine with 1G swap and never less
then 512M of swap used etc..). 
 It was possible to do that, because of large amounts of inactive code/very
rarely called code in programs, thus you could safely swap out half of the
code and safely assume that it won't ever be needed. 
 These days, most of ram goes to data, not to code, and alot of stuff works
like hash tables - every single particular page of data is accessed relatively
infrequently (thus, it would be swapped out) but there are a lot of such
accesses and if you wouldn't want to make them wait for HDD.

 As a rule of a thumb, I assume that 10000rpm HDD can't handle swap larger
then ~512M-1G and 1500rpm HDD shouldn't be burdened with more then 1-2G of
swap.

> Should I really use 32GB swap space for such machine?
 If you know that your machine will still run with ~30G swapped out...

-- 
Key fingerprint = 40D0 9FFB 9939 7320 8294  05E0 BCC7 02C4 75CC 50D9
 Total Existance Failure


More information about the Users mailing list