压力测试¶
安装 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图表。您可以使用 这个Chrome自动刷新标签页扩展 来自动刷新页面。
- 打开 http://localhost:6060/debug/pprof 并检查您是否可以访问
pprof。
运行 go run ./test/stress/tool -n 10000 来执行大量工作流。
检查 Prometheus:
- 查看正在发起的Kubernetes API请求数量。每次协调过程中您会看到约一个
Update workflows操作,多个Create pods操作。每个工作流首次协调时应该会看到一个Get workflowtemplates操作。如果发现其他异常请求,则可能存在问题。 - 记录了多少错误?
log_messages{level="error"}原因是什么?
检查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
清理¶
gcloud container clusters delete argo-workflows-stress-1