From 36a3ad875229e61c3b9cab8df608bfc761ac4329 Mon Sep 17 00:00:00 2001 From: Abdullah Gharaibeh Date: Thu, 4 Jun 2020 14:51:26 -0400 Subject: [PATCH] Added a benchmark to evaluate overhead of unschedulable pods --- .../config/performance-config.yaml | 17 +++++++++++++++++ .../scheduler_perf/config/pod-large-cpu.yaml | 14 ++++++++++++++ .../scheduler_perf/scheduler_perf_test.go | 9 +++++++-- 3 files changed, 38 insertions(+), 2 deletions(-) create mode 100644 test/integration/scheduler_perf/config/pod-large-cpu.yaml diff --git a/test/integration/scheduler_perf/config/performance-config.yaml b/test/integration/scheduler_perf/config/performance-config.yaml index 841ce0cb89a..c09dd210da6 100644 --- a/test/integration/scheduler_perf/config/performance-config.yaml +++ b/test/integration/scheduler_perf/config/performance-config.yaml @@ -240,3 +240,20 @@ - numNodes: 5000 numInitPods: [20000] numPodsToSchedule: 5000 +- template: + desc: Unschedulable + skipWaitUntilInitPodsScheduled: true + initPods: + - podTemplatePath: config/pod-large-cpu.yaml + podsToSchedule: + podTemplatePath: config/pod-default.yaml + params: + - numNodes: 500 + numInitPods: [200] + numPodsToSchedule: 1000 + - numNodes: 5000 + numInitPods: [200] + numPodsToSchedule: 5000 + - numNodes: 5000 + numInitPods: [2000] + numPodsToSchedule: 5000 diff --git a/test/integration/scheduler_perf/config/pod-large-cpu.yaml b/test/integration/scheduler_perf/config/pod-large-cpu.yaml new file mode 100644 index 00000000000..72ffeb62bfc --- /dev/null +++ b/test/integration/scheduler_perf/config/pod-large-cpu.yaml @@ -0,0 +1,14 @@ +apiVersion: v1 +kind: Pod +metadata: + generateName: pod- +spec: + containers: + - image: k8s.gcr.io/pause:3.2 + name: pause + ports: + - containerPort: 80 + resources: + requests: + cpu: 9 + memory: 500Mi diff --git a/test/integration/scheduler_perf/scheduler_perf_test.go b/test/integration/scheduler_perf/scheduler_perf_test.go index 461dca55dd1..545ad6c7dbb 100644 --- a/test/integration/scheduler_perf/scheduler_perf_test.go +++ b/test/integration/scheduler_perf/scheduler_perf_test.go @@ -68,6 +68,9 @@ type testCase struct { Nodes nodeCase // configures pods in the cluster before running the tests InitPods []podCase + // configures the test to now wait for init pods to schedule before creating + // test pods. + SkipWaitUntilInitPodsScheduled bool // pods to be scheduled during the test. PodsToSchedule podCase // optional, feature gates to set before running the test @@ -156,8 +159,10 @@ func perfScheduling(test testCase, b *testing.B) []DataItem { } total += p.Num } - if err := waitNumPodsScheduled(b, total, podInformer, setupNamespace); err != nil { - b.Fatal(err) + if !test.SkipWaitUntilInitPodsScheduled { + if err := waitNumPodsScheduled(b, total, podInformer, setupNamespace); err != nil { + b.Fatal(err) + } } // start benchmark