RFC on Cloud Images: Make /tmp a tmpfs

Seth Arnold seth.arnold at canonical.com
Fri Jan 15 00:25:04 UTC 2016

On Thu, Jan 14, 2016 at 12:27:58PM +0200, Dustin Kirkland wrote:
> Moreover, just 'sudo apt-get install swapspace' and watch as swapfiles
> are created/deleted as needed.  If your root disk is lvm-encrypted,
> then obviously such swap files are encrypted, too.

I've been severely skeptical of the swapspace package:

- Swap is used when the system is already under pressure; a few hundred
  megs is great and probably for the best but if the system is actively
  pushing beyond that then it's being pushed too hard.

- If the swap space is going to be allocated on the fly, that means the
  disk blocks have to zeroed on the fly, when the system is under
  pressure, rather than at some leisurely time beforehand.

- If the swap space is allocated on a filesystem, it's probably being
  allocated from a fragmented filesystem that's 90% full rather than a
  nice contiguous block of space as it would with a swap partition.

- Accessing further into a file may involve loading multiple indirect
  blocks from disk into unswappable kernel memory. A swap partition does
  not require indirection blocks.

- If the swap space allocated from a filesystem pushes the filesystem to
  95% full (or whatever is left after accounting for reserved blocks),
  programs will error and almost nothing handles "disk full" errors
  gracefully. Swap partitions do not cause surprise gigabyte losses in
  free space.

- Swap files can't be allocated from btrfs filesystems and probably
  shouldn't be allocated from zfs filesystems either. (Swap on zvols,

Perhaps the swapspace package uses some tasteful tunables to mitigate
against my concerns but the end result is that it contributes extra load,
extra IO pressure, and extra uncertainty at a time when the system is
already experiencing too much load, too much IO pressure, and too much

The risks and downsides of swapspace feel like a lot compared to the
slight hassle of having the installer make a swap partition.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-devel/attachments/20160114/10ae92e4/attachment.pgp>

More information about the ubuntu-devel mailing list