Articles → AWS → Swap space in AWS EC2 instances
Swap space in AWS EC2 instances
Purpose
- Content that is not in active use
- Content that is not required urgently
How To Implement Swap Space?
- First, launch a Linux EC2 instance. Once the EC2 instance is launched
- Use MobaXterm to connect to the instance
- Use the dd command to create the swap file
sudo dd if=/dev/zero of=/swapfile bs=128M count=32
- Update the read and write permission of the swap file using the following command
- Set up the Linux swap area
- Make the swap file available
- Start the swap file at boot time by editing the /etc/fstab file
- Add the following new line at the end of the file, save the file, and then exit
/swapfile swap swap defaults 0 0
How To Check If A Swap Space Is Implemented Successfully?
Click to Enlarge
Click to Enlarge