서버를 넘기기 전 CPU · 메모리 · 디스크 · 네트워크에 부하를 걸어 확인한다. stress-ng 를 쓴다.
sudo dnf install -y epel-release
sudo dnf install -y stress-ng
Ubuntu 는 sudo apt install -y stress-ng 다.
stress-ng --cpu $(nproc) --timeout 300s --metrics-brief
돌리는 동안 다른 터미널에서 온도와 클럭을 본다.
watch -n1 'grep MHz /proc/cpuinfo | head; sensors 2>/dev/null | grep -i core'
stress-ng --vm 4 --vm-bytes 80% --vm-keep --timeout 300s --metrics-brief
--vm-bytes 80% 는 전체 메모리의 80% 를 쓴다. 100% 로 잡으면 OOM Killer 가 프로세스를 죽인다.
stress-ng --hdd 4 --hdd-bytes 4G --timeout 300s --metrics-brief
실제 IOPS · 지연은 fio 가 더 정확하다.
sudo dnf install -y fio
fio --name=randrw --rw=randrw --rwmixread=70 --bs=4k --size=4G \
--numjobs=4 --iodepth=32 --runtime=120 --time_based \
--ioengine=libaio --direct=1 --group_reporting
--direct=1을 빼면 페이지 캐시 성능을 재게 되어 숫자가 실제보다 크게 나온다.
# 받는 쪽
iperf3 -s
# 보내는 쪽
iperf3 -c <서버_IP> -P 4 -t 60
운영 중인 장비에서는 돌리지 않는다. 부하 시험은 인수 전이나 점검 창에서만 한다.