스트레스 테스트 (Stress Testing)
gcloud 바이너리를 설치합니다.
본문
# Login to GCP:
gcloud auth login
# Set-up your config (if needed):
gcloud config set project alex-sb
# Create a cluster (default region is us-west-2, if you're not in west of the USA, you might want at different region):
gcloud container clusters create-auto argo-workflows-stress-1
# Get credentials:
gcloud container clusters get-credentials argo-workflows-stress-1
# Install workflows (If this fails, try running it again):
make start PROFILE=stress
# Make sure pods are running:
kubectl get deployments
# Run a test workflow:
argo submit examples/hello-world.yaml --watch
확인 사항
- http://localhost:2746/workflows를 열고 페이지가 로드되는지, 워크플로를 실행할 수 있는지 확인합니다.
- http://localhost:9090/metrics를 열고 Prometheus 메트릭이 보이는지 확인합니다.
- http://localhost:9091/graph를 열고 Prometheus 그래프가 보이는지 확인합니다. Tab Auto Refresh Chrome 확장을 사용해 페이지를 자동 새로고침할 수 있습니다.
- http://localhost:6060/debug/pprof를 열고
pprof에 접근할 수 있는지 확인합니다.
go run ./test/stress/tool -n 10000을 실행하면 대량의 워크플로를 실행합니다.
Prometheus 확인:
- 얼마나 많은 쿠버네티스 API 요청이 만들어지는지 봅니다. 리컨실레이션(reconciliation)당 하나의
Update workflows, 여러 개의Create pods가 보일 것입니다. 워크플로당 하나의Get workflowtemplates가 보여야 합니다(첫 리컨실레이션에서 수행). 그 외의 것이 보인다면 문제일 수 있습니다. - 얼마나 많은 에러가 기록되었나요?
log_messages{level="error"}원인은 무엇이었나요?
핫스팟(hot spot)이 있는지 PProf로 확인합니다:
go tool pprof -png http://localhost:6060/debug/pprof/allocs
go tool pprof -png http://localhost:6060/debug/pprof/heap
go tool pprof -png http://localhost:6060/debug/pprof/profile
정리 (Clean-up)
gcloud container clusters delete argo-workflows-stress-1
더 알아보기 (Learn more)
- 스트레스 테스트에서는 API 요청 패턴(
Update workflows,Create pods,Get workflowtemplates)과 에러 로그 수가 핵심 관찰 지표입니다. - pprof의 allocs/heap/profile 엔드포인트로 컨트롤러의 메모리·CPU 핫스팟을 시각화할 수 있습니다.