Random notes regarding swap space and swap partitions.

What is swap space?

Swap space is an area where processes are swapped in and out to effectively manage processes which share CPU time.

Swap space is like extra RAM which increases processing power of the CPU but should not be considered a solution in lieu of RAM. Swap space is not on the RAM, but located on the HD.

- Slower than RAM.

- Thrashing - When the kernel creates a volatile and unstable cycle of swapping processes.

- You may resolve thrashing by reducing the swappiness value.

Not unlike the nice value (when using Glances for network monitoring), the nicer a process is the higher the positive value. The higher the negative value, the more of a demand the process is creating for CPU time.

Glances is a cross-platform monitoring tool which aims to present a large amount of monitoring information through a curses or Web based interface. 



The best way to modify a swap file is to use rescue mode. This avoids conflicts with processes in swap space and swap space being used by the kernel. 

A swap file should be used if you plan to modify it regularly, as it can be easily resized. 

Large amounts of RAM on a server typically require smaller swap partitions.

Swap space is what allows multiple browsers/tabs and applications to be used simultaneously.

Your swap partition should be twice the amount of your physical RAM up to 2GB. After that 1GB for every 1GB of physical RAM.


Comments

Popular posts from this blog

Python script - Office supply program

2023: Bash script for system administration

Amazon Macie in a nutshell - 2023 AWS service