k3s/test/integration/scheduler_perf
Kubernetes Submit Queue 75339d33cf
Merge pull request #64936 from wgliang/master.scheduler_perf_test
Automatic merge from submit-queue (batch tested with PRs 64122, 64936, 65288, 65383). If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

fix integer divide by zero panic

**What this PR does / why we need it**:
/kind bug

fix integer divide by zero panic when time.Since(start) < 1s

**Which issue(s) this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close the issue(s) when PR gets merged)*:
Fixes #64935

**Special notes for your reviewer**:

**Release note**:

```release-note
NONE
```
2018-06-22 19:03:16 -07:00
..
BUILD Run hack/update-bazel.sh 2018-06-22 16:22:57 -07:00
OWNERS Add bsalamat to sig-scheduling-maintainers 2017-09-11 11:10:57 -07:00
README.md generate files before scheduler perf 2017-08-22 16:40:16 +08:00
main_test.go use testmain in integration tests 2017-07-12 17:34:55 -07:00
scheduler_bench_test.go Add scheduler benchmark tests for affinity rules. 2017-12-20 12:53:12 -08:00
scheduler_perf_types.go # This is a combination of 2 commits. 2017-07-19 00:28:40 -04:00
scheduler_test.go fix integer divide by zero panic 2018-06-09 09:26:19 +08:00
test-performance.sh
util.go remove knob of equiv class in perf test 2018-05-18 17:17:03 -07:00

README.md

Scheduler Performance Test

Motivation

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:

  • Save time on testing
    • The test and benchmark can be run in a single box. We only set up components necessary to scheduling without booting up a cluster.
  • Profiling runtime metrics to find out bottleneck
    • Write scheduler integration test but focus on performance measurement. Take advantage of go profiling tools and collect fine-grained metrics, like cpu-profiling, memory-profiling and block-profiling.
  • Reproduce test result easily
    • We want to have a known place to do the performance related test for scheduler. Developers should just run one script to collect all the information they need.

Currently the test suite has the following:

  • density test (by adding a new Go test)
    • schedule 30k pods on 1000 (fake) nodes and 3k pods on 100 (fake) nodes
    • print out scheduling rate every second
    • let you learn the rate changes vs number of scheduled pods
  • benchmark
    • make use of go test -bench and report nanosecond/op.
    • schedule b.N pods when the cluster has N nodes and P scheduled pods. Since it takes relatively long time to finish one round, b.N is small: 10 - 100.

How To Run

# In Kubernetes root path
make generated_files

cd test/integration/scheduler_perf
./test-performance.sh

Analytics

Analytics