Virtual Memory Swap Space in ScaleArc
This article will introduce swap space recommendations for ScaleArc.
First, we need to define different types of memory virtualization.
Virtual memory storage is generally referred to in the UNIX world as "swap space." Technically, however, this virtual memory storage space is used for two purposes: paging, and swapping.
Paging is the process of copying individual pages of memory (whose size is configurable at kernel build time-- generally between 512 and 4096 bytes; ScaleArc uses 4096) onto disk, and when some other process later requires memory, releasing a least-recently-used page of memory that also exists on disk from its original owning process to the process requesting memory. Obviously, when the original process gets CPU quantum, if it attempts to access that page it will receive a page fault and lose quantum; the operating system will then read the data from disk and re-instantiate it in a new region of memory, then return the owning process to the executable list once its memory is again available.
Swapping is the process of paging out an entire process, not just portions of its memory.
ScaleArc works best with a large amount of RAM, little if any paging of memory, and no swapping. The main function of memory in ScaleArc's real-time components is to provide real-time access to configuration, and for cache; for most ScaleArc real-time operations, the use of paging and swapping is therefore antithetical to ScaleArc's main purpose. However, some parts of ScaleArc (notably Analytics) tolerate paging and even swapping quite well, and experience little if any effect on their operations from it.
In Linux, memory management requires that there be swap space when memory is allocated; therefore, if swap space fills up, memory allocation routines can fail even though there is abundant real memory available. It is therefore necessary to allocate sufficient swap space to cover ScaleArc's requirements, without overspending disk space that will never be used.
In older versions of UNIX, it was often said that "swap space should be twice RAM" as a rule of thumb. With today's much larger systems and more efficient memory management algorithms, this can be somewhat relaxed, particularly with very large realtime configurations. Based on our experience in the field, we have recommended starting places for configuration of swap space on ScaleArc appliances.
Recommendations for swap space allocation are based on the amount of RAM in the system. ScaleArc recommends the following as minimum configurations:
0-8GB RAM: Swap space should be twice the amount of RAM
8GB-64GB RAM: Swap space 16GB minimum
64-256GB RAM: Swap space 32GB minimum
These should be sufficient for most configurations. ScaleArc has a warning for swap space usage, set at 75% usage (25% free). This will appear just under the top line of the ScaleArc UI, and is stored in the Alert log. If you see this warning, you should probably consider increasing your swap space, and also investigating what is using the space since the real-time components could experience a marked loss of performance if their memory is being swapped. You will find instructions for increasing swap space in the article titled, "Adding filesystem, partition, and swap space" in this knowledge base.
If you are experiencing issues with ScaleArc or with any of it's features, please contact ScaleArc Support. We are available 24x7 by phone at 855 800 7225 or +1 408 412 7315. For general support inquiries, you can also e-mail us at email@example.com.
2901 Tasman Drive Santa Clara, CA 95054 | Email: firstname.lastname@example.org