< Back to Monitors List

Swap Usage Monitor

Swap space is a part of secondary storage that is used as virtual memory. When the main memory (or primary storage) is full, inactive pages (data in the main memory that is not required by currently running processes) are moved to virtual memory, and then moved back when required. This swapping frees up the main memory for frequently processed data. Using secondary storage as virtual memory can increase performance for systems that have little main memory available. However, swap space does not replace or increase physical memory, because secondary storage is much slower to read from and write to. It should be used only for infrequent swapping of data that does not require a lot of processing.

Swap usage refers to the percentage of virtual memory that is currently being used to temporarily store inactive pages from the main physical memory. It is crucial to monitor swap usage, because swap space is your “safety net” for when you run out of RAM. While swapping, processes may get slower, data is still nevertheless processed. However, when you run out of virtual memory, processes are queued and stalled until some memory is freed up.

Swap Usage Monitor Chart - Anturis

The amount of data swapped is not as important as the rate at which swapping occurs. An efficient system may swap-out a lot of inactive pages at a slow rate, leaving RAM space for frequently processed data. A more important metric is the swap-out rate, which refers to the rate (in kilobytes per second, KB/s) at which memory is swapped from main memory to virtual memory. Swap-out rate is measured over a sample period of time. The higher this metric is, the more frequently the disk is accessed for swapping. Since the disk is secondary storage, which is slow, higher rates mean slower data processing. Even when swap space is not particularly full, continuously high swap-out rates indicate that the pages that are swapped are actively processed. This means that your system requires more fast physical memory for your workloads, and swap is not helping.

Monitoring swap usage and swap rate can help analyze the workloads on your server. For example, if you determine that most of the processes require fast processing, you need to have enough main memory, while virtual memory will not help much. On the other hand, if a lot of processing is fairly slow with large chunks of data stored in memory between calculations, you can use swapping to free up the main memory for faster client request processing. Balancing the workloads both across servers and on each separate server is the key to providing efficient services. Understanding the benefits of swapping can help with this balancing.

Using the Anturis Console, you can set up monitoring of swap usage and swap rate for any hardware component (a server computer) in your infrastructure by adding the SwapUsage monitor to the component.

©2016 Anturis Inc. All Rights Reserved.