[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: TMPDIR - Do we also need a drive backed TPMDIR ? [and 1 more messages]



On Thu, 2016-07-21 at 11:40 -0700, Russ Allbery wrote:
> Ian Jackson <ijackson@chiark.greenend.org.uk> writes:
> 
> > Uhhh.  You run your systems with no swap at all ?
> 
> > That's your prerogative, of course.  But it's far from a default (or
> > recommended) configuration.  I think that if you configure your system
> > without swap, it is up to you do whatever else is necessary to make it
> > work.  That might involve making /tmp not be on a tmpfs (if it is the
> > default for some reason).
> 
> I never use swap on servers any more.  My experience is that swap is so
> slow that if the system starts using swap, the services are all
> essentially down anyway,

It's true that if the system has to swap a lot of data out then it is
likely to become unresponsive.  However, I think there are good reasons
to enable a small amount of swap space:

- Some long-running applications have, effectively, memory leaks of a
bounded size that can profitably be swapped out
- The exact same problem can occur with memory-mapped files, and by
disabling swap you prevent the kernel from balancing demand for
anonymous and file-backed memory

Linux used to have the problem that allocating multi-page blocks
(commonly needed on architectures with 4K pages) could require
reclaiming single pages in the way.  This is much less of an issue now
that the VM manager implements compaction (since 2.6.35).

In some kernels and configurations, forking a large process requires
reserving memory for another copy of all its anonymous pages, so it's
more likely to fail if there's no swap available.  I don't think this
is an issue with the default overcommit setting in Linux, though.

[...]
> It's a lot easier to tolerate a server just going
> away than a server that goes into pathological performance from using
> swap.

Agreed.

Ben.

> Desktops and laptops are obviously a different issue with different
> tradeoffs.
> 
-- 

Ben Hutchings
Absolutum obsoletum. (If it works, it's out of date.) - Stafford Beer

Attachment: signature.asc
Description: This is a digitally signed message part


Reply to: