|
5 年之前 | |
---|---|---|
.. | ||
config | 5 年之前 | |
BUILD | 5 年之前 | |
OWNERS | 5 年之前 | |
README.md | 5 年之前 | |
main_test.go | 5 年之前 | |
scheduler_bench_test.go | 5 年之前 | |
scheduler_perf_test.go | 5 年之前 | |
scheduler_perf_types.go | 5 年之前 | |
scheduler_test.go | 5 年之前 | |
util.go | 5 年之前 |
We already have a performance testing system -- Kubemark. However, Kubemark requires setting up and bootstrapping a whole cluster, which takes a lot of time.
We want to have a standard way to reproduce scheduling latency metrics result and benchmark scheduler as simple and fast as possible. We have the following goals:
Currently the test suite has the following:
go test -bench
and report nanosecond/op.# In Kubernetes root path
make test-integration WHAT=./test/integration/scheduler_perf KUBE_TEST_VMODULE="''" KUBE_TEST_ARGS="-alsologtostderr=true -logtostderr=true -run=." KUBE_TIMEOUT="--timeout=60m" SHORT="--short=false"
# In Kubernetes root path
make test-integration WHAT=./test/integration/scheduler_perf KUBE_TEST_VMODULE="''" KUBE_TEST_ARGS="-alsologtostderr=false -logtostderr=false -run=^$$ -benchtime=1ns -bench=BenchmarkPerfScheduling"
The benchmark suite runs all the tests specified under config/performance-config.yaml.
Once the benchmark is finished, JSON file with metrics is available in the current directory (test/integration/scheduler_perf). Look for BenchmarkPerfScheduling_YYYY-MM-DDTHH:MM:SSZ.json
.
You can use -data-items-dir
to generate the metrics file elsewhere.
In case you want to run a specific test in the suite, you can specify the test through -bench
flag:
Also, bench time is explicitly set to 1ns (-benchtime=1ns
flag) so each test is run only once.
Otherwise, the golang benchmark framework will try to run a test more than once in case it ran for less than 1s.
# In Kubernetes root path
make test-integration WHAT=./test/integration/scheduler_perf KUBE_TEST_VMODULE="''" KUBE_TEST_ARGS="-alsologtostderr=false -logtostderr=false -run=^$$ -benchtime=1ns -bench=BenchmarkPerfScheduling/SchedulingBasic/5000Nodes/5000InitPods/1000PodsToSchedule"
To produce a cpu profile:
# In Kubernetes root path
make test-integration WHAT=./test/integration/scheduler_perf KUBE_TIMEOUT="-timeout=3600s" KUBE_TEST_VMODULE="''" KUBE_TEST_ARGS="-alsologtostderr=false -logtostderr=false -run=^$$ -benchtime=1ns -bench=BenchmarkPerfScheduling -cpuprofile ~/cpu-profile.out"