Swap Space allocated for BOSH-Deployed VMs
search cancel

Swap Space allocated for BOSH-Deployed VMs

book

Article ID: 293548

calendar_today

Updated On:

Products

Operations Manager

Issue/Introduction

How much swap space is allocated out of the total ephemeral disk space in a BOSH-deployed virtual machine (VM)?

Resolution

BOSH creates 2 partitions on the ephemeral disk /dev/sdb:

  1. /dev/sdb1
    • Used for swap.
  2. /dev/sdb2
    • Used for ephemeral storage.
    • Mounted to /var/vcap/data.

BOSH will create the /dev/sdb1 swap partition to be equal to one of the following, whichever is smaller:

  • RAM
  • 1/2 of ephemeral disk

This means the swap partition can consume up to 1/2 of the ephemeral disk for instance types with large amounts of memory relative to the disk size.

Some examples with different RAM and ephemeral disk sizes:

RAM Ephemeral Disk Swap (sdb1)    /var/vcap/data/ (sdb2) Notes
1 GB 2 GB 1 GB 1 GB Set to RAM
512 MB 1 GB 512 MB 1.5 GB Set to RAM
2 GB 4 GB 2 GB 2 GB Set to RAM
2 GB 16 GB 2 GB 14 GB Set to RAM
4 GB 8 GB 4 GB 4 GB Set to RAM
8 GB 8 GB 4 GB 4 GB Set to 1/2 ephemeral disk
4 GB 32 GB 4 GB 28 GB Set to RAM
2 GB 8 GB 2 GB 6 GB Set to RAM
8 GB 16 GB 8 GB 8 GB Set to RAM
16 GB 16 GB 8 GB 8 GB Set to 1/2 ephemeral disk
8 GB 64 GB 8 GB 56 GB Set to RAM
4 GB 16 GB 4 GB 12 GB Set to RAM
16 GB 32 GB 16 GB 16 GB Set to RAM
32 GB 32 GB 16 GB 16 GB Set to 1/2 ephemeral disk
16 GB 128 GB 16 GB 112 GB Set to RAM
8 GB 32 GB 8 GB 24 GB Set to RAM
32 GB 64 GB 32 GB 32 GB Set to RAM
64 GB 64 GB 32 GB 32 GB Set to 1/2 ephemeral disk
32 GB 256 GB 32 GB 224 GB Set to RAM
16 GB 64 GB 16 GB 48 GB Set to RAM