3: Available Swap Space

Swapping is part of any virtual storage system – it is the activity of writing copies of blocks of RAM out to disk to free up the RAM for other applications’ use. When the block of RAM on disk is needed, it is read back into RAM (these two activities are called ‘Swapping Out‘ and ‘Swapping In‘)

To ensure swapping is working effectively and efficiently it’s essential you have sufficient disk space on your Linux servers – not just free disk space, but allocated Swap space.

The Argent Rule SCP_LINUX_SWAP_SPACE monitors Swap space.

When this Rule breaks here are the most likely villains, in order of likeliness:

  • A program is poorly written
  • The Swap space allocation is too small
  • System needs more RAM

In the first case, look for very high page fault rates (a page fault generally creates a Swap event). If the code is in-house, or you have the source, look for a large table that is randomly accessed; sorts typically use a lot of Swap space (have a large ‘working set’)

The second case is easy to correct – simply increase the size of the Swap space (always try to use the fastest disk in terms of RPM).

The Swap partition should be about twice the RAM size. It is not recommended to increase it beyond this point because it will take up more physical RAM (Swap tables are maintained in RAM only), and slow down the system even more.