Skip to content

Commit f72299b

Browse files
authored
Merge pull request kubernetes#91787 from ahg-g/ahg-bench
A benchmark to evaluate overhead of unschedulable pods
2 parents 454c13d + 36a3ad8 commit f72299b

File tree

3 files changed

+38
-2
lines changed

3 files changed

+38
-2
lines changed

test/integration/scheduler_perf/config/performance-config.yaml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -240,3 +240,20 @@
240240
- numNodes: 5000
241241
numInitPods: [20000]
242242
numPodsToSchedule: 5000
243+
- template:
244+
desc: Unschedulable
245+
skipWaitUntilInitPodsScheduled: true
246+
initPods:
247+
- podTemplatePath: config/pod-large-cpu.yaml
248+
podsToSchedule:
249+
podTemplatePath: config/pod-default.yaml
250+
params:
251+
- numNodes: 500
252+
numInitPods: [200]
253+
numPodsToSchedule: 1000
254+
- numNodes: 5000
255+
numInitPods: [200]
256+
numPodsToSchedule: 5000
257+
- numNodes: 5000
258+
numInitPods: [2000]
259+
numPodsToSchedule: 5000
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
apiVersion: v1
2+
kind: Pod
3+
metadata:
4+
generateName: pod-
5+
spec:
6+
containers:
7+
- image: k8s.gcr.io/pause:3.2
8+
name: pause
9+
ports:
10+
- containerPort: 80
11+
resources:
12+
requests:
13+
cpu: 9
14+
memory: 500Mi

test/integration/scheduler_perf/scheduler_perf_test.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,9 @@ type testCase struct {
6868
Nodes nodeCase
6969
// configures pods in the cluster before running the tests
7070
InitPods []podCase
71+
// configures the test to now wait for init pods to schedule before creating
72+
// test pods.
73+
SkipWaitUntilInitPodsScheduled bool
7174
// pods to be scheduled during the test.
7275
PodsToSchedule podCase
7376
// optional, feature gates to set before running the test
@@ -156,8 +159,10 @@ func perfScheduling(test testCase, b *testing.B) []DataItem {
156159
}
157160
total += p.Num
158161
}
159-
if err := waitNumPodsScheduled(b, total, podInformer, setupNamespace); err != nil {
160-
b.Fatal(err)
162+
if !test.SkipWaitUntilInitPodsScheduled {
163+
if err := waitNumPodsScheduled(b, total, podInformer, setupNamespace); err != nil {
164+
b.Fatal(err)
165+
}
161166
}
162167

163168
// start benchmark

0 commit comments

Comments
 (0)