Docker CPU 부하 테스트

1 개요[ | ]

Docker CPU 부하 테스트
  • spawn N workers spinning on sqrt()
CPU 부하
docker run --name stress --rm -it progrium/stress --timeout 20s --cpu 1
모니터링
# 실시간으로 확인하면서 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[ | ]

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
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 눌러 종료
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[ | ]

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
root@localhost:~# docker stats --format "table {{.Name}}\t{{.CPUPerc}}\t{{.MemUsage}}" | tee stats.txt
NAME                CPU %               MEM USAGE / LIMIT
...
→ 컨테이너가 사라지면 Ctrl+C 눌러 종료
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 같이 보기[ | ]

5 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}