VPS & Linux

Linux Swap Size Calculator

Get the right swap size for your server in seconds — with ready-to-paste Linux commands.

VPS & 리눅스

리눅스 스왑 크기 계산기

서버에 맞는 최적 스왑 크기를 즉시 계산하고 바로 사용할 수 있는 명령어를 확인하세요.

Server Configuration

Hibernation Support

Requires swap ≥ RAM size

Use Swap File

vs. swap partition

Recommended Swap

2 GB
Optimal for this config

Recommended swappiness 10
Type Swap file
Disk needed 2 GB

Commands


            
          

How to Use

STEP 1

Select your RAM

Choose the total RAM your Linux server or VPS currently has. If you're planning an upgrade, use the target RAM size.

STEP 2

Choose your use case

General VPS, database, dev machine, or desktop — each has different swap behaviour and swappiness recommendations.

STEP 3

Toggle options

Enable hibernation if you need suspend-to-disk. Choose swap file (flexible) vs. swap partition (slightly faster).

STEP 4

Copy & paste commands

The generated commands create the swap file, set permissions, enable it, and make it persist across reboots via /etc/fstab.

사용 방법

STEP 1

RAM 선택

현재 서버 또는 VPS의 총 RAM을 선택하세요. 업그레이드를 계획 중이라면 목표 RAM 크기를 입력하세요.

STEP 2

사용 목적 선택

일반 VPS, 데이터베이스, 개발 서버, 데스크탑 — 각각 스왑 동작과 swappiness 설정이 다릅니다.

STEP 3

옵션 설정

절전(hibernation)이 필요하면 활성화하세요. 스왑 파일(유연함) 또는 스왑 파티션(약간 더 빠름)을 선택하세요.

STEP 4

명령어 복사 & 붙여넣기

생성된 명령어로 스왑 파일 생성, 권한 설정, 활성화, /etc/fstab 등록까지 한 번에 처리하세요.

Frequently Asked Questions

For a 2 GB RAM VPS running a general server workload, 2 GB of swap is the standard recommendation. This equals 1x RAM, which follows the modern guideline for servers with 2–8 GB RAM. If you run memory-intensive applications or want hibernation support, increase to 4 GB.
Yes — even with plenty of RAM, a small swap (1–2 GB minimum) is recommended on Linux servers. The kernel uses swap to move idle memory pages out, freeing RAM for active processes. Without swap, the OOM killer will terminate processes when RAM runs out instead of gracefully swapping.
Swap files are more flexible: you can resize or delete them without repartitioning. Swap partitions are marginally faster on traditional HDDs, but on modern SSDs and cloud VPS storage the difference is negligible. For most cloud VPS users, a swap file is the better choice.
Swappiness (0–100) controls how aggressively the kernel moves memory pages to swap. A value of 60 is the Linux default, good for desktops. For servers, 10 reduces unnecessary swapping and keeps data in RAM longer — improving responsiveness under normal load. Database servers often use 1–5 to minimise swap use entirely.
Swap is much slower than RAM — especially on HDDs. On cloud VPS storage (NVMe/SSD) it's faster but still a significant bottleneck. Swap is a safety net, not a performance feature. If your server is hitting swap regularly, it's a signal to upgrade your VPS plan to one with more RAM.

자주 묻는 질문

2GB RAM VPS에서 일반 서버 용도라면 2GB 스왑이 표준 권장값입니다. RAM과 동일한 1:1 비율로, 2~8GB RAM 서버의 현대 권장 가이드라인을 따릅니다. 메모리 집약적 앱 실행이나 절전 모드가 필요하면 4GB로 늘리세요.
RAM이 충분해도 최소 1~2GB 스왑을 권장합니다. 커널은 유휴 메모리 페이지를 스왑으로 옮겨 활성 프로세스에 RAM을 확보합니다. 스왑 없이 RAM이 가득 차면 OOM killer가 프로세스를 강제 종료합니다.
스왑 파일이 더 유연합니다. 파티션 재구성 없이 크기 조정이나 삭제가 가능합니다. 스왑 파티션은 구형 HDD에서 약간 빠르지만, 현대 SSD나 클라우드 VPS 스토리지에서는 차이가 미미합니다. 대부분의 클라우드 VPS 사용자에게는 스왑 파일이 더 실용적입니다.
Swappiness(0~100)는 커널이 메모리 페이지를 스왑으로 이동하는 적극성을 제어합니다. 기본값 60은 데스크탑에 적합합니다. 서버에는 10을 권장 — 불필요한 스왑을 줄이고 데이터를 RAM에 더 오래 유지합니다. 데이터베이스 서버는 1~5로 설정해 스왑을 최소화합니다.
스왑은 RAM보다 훨씬 느립니다 — 특히 HDD에서. 클라우드 VPS SSD에서도 상당한 병목이 됩니다. 스왑은 성능 향상이 아닌 안전망입니다. 서버가 스왑을 자주 사용한다면 RAM이 더 많은 플랜으로 업그레이드할 신호입니다.