1 개요[ | ]
- Docker CPU 부하 테스트
- spawn N workers spinning on sqrt()
CPU 부하
Bash
Copy
docker run --name stress --rm -it progrium/stress --timeout 20s --cpu 1
모니터링
Bash
Copy
# 실시간으로 확인하면서 stats.txt 에도 기록
docker stats --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}" | tee stats.txt
# 최대치 3건 조회
cat stats.txt | grep stress | sort -V | tail -3
2 실행예시: CPU 1[ | ]
Console
Copy
root@localhost:~# docker run --name stress --rm -it progrium/stress --timeout 20s --cpu 1
stress: info: [1] dispatching hogs: 1 cpu, 0 io, 0 vm, 0 hdd
stress: dbug: [1] using backoff sleep of 3000us
stress: dbug: [1] setting timeout to 20s
stress: dbug: [1] --> hogcpu worker 1 [6] forked
stress: dbug: [1] <-- worker 6 signalled normally
stress: info: [1] successful run completed in 20s
Console
Copy
root@localhost:~# docker stats --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}" | tee stats.txt
NAME CPU % MEM USAGE / LIMIT
stress 100.20% 768KiB / 461.8MiB
- → 컨테이너가 사라지면 Ctrl+C 눌러 종료
Console
Copy
root@localhost:~# cat stats.txt | grep stress | sort -V | tail -3
stress 100.60% 768KiB / 461.8MiB
stress 100.70% 768KiB / 461.8MiB
stress 100.70% 768KiB / 461.8MiB
3 실행예시: CPU 2[ | ]
Console
Copy
root@localhost:~# docker run --name stress --rm -it progrium/stress --timeout 20s --cpu 2
stress: info: [1] dispatching hogs: 2 cpu, 0 io, 0 vm, 0 hdd
stress: dbug: [1] using backoff sleep of 6000us
stress: dbug: [1] setting timeout to 20s
stress: dbug: [1] --> hogcpu worker 2 [6] forked
stress: dbug: [1] using backoff sleep of 3000us
stress: dbug: [1] setting timeout to 20s
stress: dbug: [1] --> hogcpu worker 1 [7] forked
stress: dbug: [1] <-- worker 6 signalled normally
stress: dbug: [1] <-- worker 7 signalled normally
stress: info: [1] successful run completed in 20s
Console
Copy
root@localhost:~# docker stats --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}" | tee stats.txt
NAME CPU % MEM USAGE / LIMIT
...
- → 컨테이너가 사라지면 Ctrl+C 눌러 종료
Console
Copy
root@localhost:~# cat stats.txt | grep stress | sort -V | tail -3
stress 198.95% 852KiB / 461.8MiB
stress 199.08% 852KiB / 461.8MiB
stress 199.08% 852KiB / 461.8MiB
4 같이 보기[ | ]
- docker stats
- 리눅스 stress
- Docker CPU 부하 테스트
- Docker IO 부하 테스트
- Docker 메모리 부하 테스트
- Docker 디스크 부하 테스트
- Docker run --cpus 컨테이너 CPU 사용량 제한하기
5 참고[ | ]
편집자 Jmnote
로그인하시면 댓글을 쓸 수 있습니다.