Questions re swap and hibernate interaction on 8 gig machine

Robert Brockway robert-5LEc/6Zm6xCUd8a0hrldnti2O/JbrIOy at public.gmane.org
Fri Jun 25 14:18:34 UTC 2010


On Mon, 21 Jun 2010, Christopher Browne wrote:

> On Linux, these days, the value shouldn't be very important.  If you
> don't expect to want to swap, it wouldn't be unreasonable to have NO
> swap.

I notice a number of people have mentioned running with no swap.  While 
that is certainly possible I still argue in favour of having some swap, 
even if swappiness is set to 0.

My arguments are set out here:

http://www.practicalsysadmin.com/wiki/index.php/Swap

> There have been times on varying versions of Unix where 2x or more
> swap was *required*, and I recall there being a bug on Linux at one
> time that required you to have a quantity of swap resembling 2x RAM.

IIRC the system wouldn't swap unless it had _at least_ 2x ram which meant 
most systems stopped swapping entirely :)  That bug was fixed *fast*.

> But old requirements on other operating systems, and bugs on elderly
> versions of Linux, should not be treated as binding requirements here,
> today.

Agreed.

> I'd think a main reason to want to have a lot of swap would be if you
> wanted to have a rather large tempfs filesystem.   But the data's

I'm not a fan of using tmpfs for /tmp.  I think it is a solution looking 
for a problem.   Essentially I argue that most apps write so little to 
/tmp that the use of a special case isn't warranted.

Other uses of tmpfs may make a lot of sense though.

The other main reason for swap is the one the OP asked about - 
hibernation.  A swap partition is needed - you can't swap to a swap file 
under Linux[1].  In principal you'd need as much swap as ram to guarantee 
a successful hibernation but it could work with less.  If there aren't 
sufficient resources the hibernation should fail gracefully.  Personally I 
use sleep a lot and rarely hibernate.

[1] Last time I checked.  Theoretically it is possible.  I'd love to hear 
this had been fixed but I haven't seen any reports.

Cheers,

Rob

-- 
Email: robert-5LEc/6Zm6xCUd8a0hrldnti2O/JbrIOy at public.gmane.org		Linux counter ID #16440
IRC: Solver (OFTC & Freenode)
Web: http://www.practicalsysadmin.com
Open Source: The revolution that silently changed the world
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list