AWS 스왑 메모리 구성하기

RedHat 공식 사이트에서는 스왑 영역을 구성할 때 스왑 파티션, 스왑 파일 그리고 스왑 파티션과 스왑 파일의 조합이 있다. 그 중 스왑 파티션을 권장한다.

 

AWS EC2에서 사용하고 있는 램이 1gb이기에 스왑 영역은 2gb로 구성해주었다.

 

In this example dd command, the swap file is 2GB (128 MB x 16):
1.sudo dd if=/dev/zero of=/swapfile bs=128M count=16
2. sudo chmod 0600 /swapfile
3. mkswap /swapfile
4. sudo swapon /swapfile
5. vi /etc/fstab

/swapfile swap swap defaults 0 0

6.systemctl daemon-reload


확인 명령어는 다음과 같다 `cat /proc/swap` 또는 `free -h` 또는 `swapon -s`
Ref 

https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/8/html/managing_storage_devices/getting-started-with-swap_managing-storage-devices#getting-started-with-swap_managing-storage-devices

https://docs.redhat.com/en/documentation/red_hat_enterprise_linux/7/html/storage_administration_guide/ch-swapspace  https://repost.aws/knowledge-center/ec2-memory-swap-file](https://repost.aws/knowledge-center/ec2-memory-swap-file

 

'Linux' 카테고리의 다른 글

AWS EBS 볼륨 확장하기  (0) 2024.06.24
Raid 구성하기  (0) 2024.06.22
Crontab을 이용한 SSL 인증서 자동 갱신  (0) 2024.06.19
HardLink and SoftLink  (0) 2024.06.09
AWS EC2 Nginx 설치  (0) 2024.06.09