Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
2632a6a6
Commit
2632a6a6
authored
Aug 02, 2018
by
Maciej Borsz
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Scalability tests: Increase sample size for pod startup latency measurement.
parent
4bec356e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
70 additions
and
60 deletions
+70
-60
density.go
test/e2e/scalability/density.go
+70
-60
No files found.
test/e2e/scalability/density.go
View file @
2632a6a6
...
...
@@ -56,6 +56,7 @@ const (
MinSaturationThreshold
=
2
*
time
.
Minute
MinPodsPerSecondThroughput
=
8
DensityPollInterval
=
10
*
time
.
Second
MinPodStartupMeasurements
=
500
)
// Maximum container failures this test tolerates before failing.
...
...
@@ -696,7 +697,10 @@ var _ = SIGDescribe("Density", func() {
}
e2eStartupTime
=
runDensityTest
(
dConfig
,
testPhaseDurations
,
&
scheduleThroughputs
)
if
itArg
.
runLatencyTest
{
By
(
"Scheduling additional Pods to measure startup latencies"
)
// Pick latencyPodsIterations so that:
// latencyPodsIterations * nodeCount >= MinPodStartupMeasurements.
latencyPodsIterations
:=
(
MinPodStartupMeasurements
+
nodeCount
-
1
)
/
nodeCount
By
(
fmt
.
Sprintf
(
"Scheduling additional %d Pods to measure startup latencies"
,
latencyPodsIterations
*
nodeCount
))
createTimes
:=
make
(
map
[
string
]
metav1
.
Time
,
0
)
nodeNames
:=
make
(
map
[
string
]
string
,
0
)
...
...
@@ -775,58 +779,76 @@ var _ = SIGDescribe("Density", func() {
go
controller
.
Run
(
stopCh
)
}
// Create some additional pods with throughput ~5 pods/sec.
latencyPodStartupPhase
:=
testPhaseDurations
.
StartPhase
(
800
,
"latency pods creation"
)
defer
latencyPodStartupPhase
.
End
()
var
wg
sync
.
WaitGroup
wg
.
Add
(
nodeCount
)
// Explicitly set requests here.
// Thanks to it we trigger increasing priority function by scheduling
// a pod to a node, which in turn will result in spreading latency pods
// more evenly between nodes.
cpuRequest
:=
*
resource
.
NewMilliQuantity
(
nodeCpuCapacity
/
5
,
resource
.
DecimalSI
)
memRequest
:=
*
resource
.
NewQuantity
(
nodeMemCapacity
/
5
,
resource
.
DecimalSI
)
if
podsPerNode
>
30
{
// This is to make them schedulable on high-density tests
// (e.g. 100 pods/node kubemark).
cpuRequest
=
*
resource
.
NewMilliQuantity
(
0
,
resource
.
DecimalSI
)
memRequest
=
*
resource
.
NewQuantity
(
0
,
resource
.
DecimalSI
)
}
rcNameToNsMap
:=
map
[
string
]
string
{}
for
i
:=
1
;
i
<=
nodeCount
;
i
++
{
name
:=
additionalPodsPrefix
+
"-"
+
strconv
.
Itoa
(
i
)
nsName
:=
namespaces
[
i
%
len
(
namespaces
)]
.
Name
rcNameToNsMap
[
name
]
=
nsName
go
createRunningPodFromRC
(
&
wg
,
c
,
name
,
nsName
,
imageutils
.
GetPauseImageName
(),
additionalPodsPrefix
,
cpuRequest
,
memRequest
)
time
.
Sleep
(
200
*
time
.
Millisecond
)
}
wg
.
Wait
()
latencyPodStartupPhase
.
End
()
latencyMeasurementPhase
:=
testPhaseDurations
.
StartPhase
(
810
,
"pod startup latencies measurement"
)
defer
latencyMeasurementPhase
.
End
()
By
(
"Waiting for all Pods begin observed by the watch..."
)
waitTimeout
:=
10
*
time
.
Minute
for
start
:=
time
.
Now
();
len
(
watchTimes
)
<
nodeCount
;
time
.
Sleep
(
10
*
time
.
Second
)
{
if
time
.
Since
(
start
)
<
waitTimeout
{
framework
.
Failf
(
"Timeout reached waiting for all Pods being observed by the watch."
)
for
latencyPodsIteration
:=
0
;
latencyPodsIteration
<
latencyPodsIterations
;
latencyPodsIteration
++
{
podIndexOffset
:=
latencyPodsIteration
*
nodeCount
framework
.
Logf
(
"Creating %d latency pods in range [%d, %d]"
,
nodeCount
,
podIndexOffset
+
1
,
podIndexOffset
+
nodeCount
)
watchTimesLen
:=
len
(
watchTimes
)
// Create some additional pods with throughput ~5 pods/sec.
latencyPodStartupPhase
:=
testPhaseDurations
.
StartPhase
(
800
+
latencyPodsIteration
*
10
,
"latency pods creation"
)
defer
latencyPodStartupPhase
.
End
()
var
wg
sync
.
WaitGroup
wg
.
Add
(
nodeCount
)
// Explicitly set requests here.
// Thanks to it we trigger increasing priority function by scheduling
// a pod to a node, which in turn will result in spreading latency pods
// more evenly between nodes.
cpuRequest
:=
*
resource
.
NewMilliQuantity
(
nodeCpuCapacity
/
5
,
resource
.
DecimalSI
)
memRequest
:=
*
resource
.
NewQuantity
(
nodeMemCapacity
/
5
,
resource
.
DecimalSI
)
if
podsPerNode
>
30
{
// This is to make them schedulable on high-density tests
// (e.g. 100 pods/node kubemark).
cpuRequest
=
*
resource
.
NewMilliQuantity
(
0
,
resource
.
DecimalSI
)
memRequest
=
*
resource
.
NewQuantity
(
0
,
resource
.
DecimalSI
)
}
}
close
(
stopCh
)
nodeToLatencyPods
:=
make
(
map
[
string
]
int
)
for
i
:=
range
latencyPodStores
{
for
_
,
item
:=
range
latencyPodStores
[
i
]
.
List
()
{
pod
:=
item
.
(
*
v1
.
Pod
)
nodeToLatencyPods
[
pod
.
Spec
.
NodeName
]
++
rcNameToNsMap
:=
map
[
string
]
string
{}
for
i
:=
1
;
i
<=
nodeCount
;
i
++
{
name
:=
additionalPodsPrefix
+
"-"
+
strconv
.
Itoa
(
podIndexOffset
+
i
)
nsName
:=
namespaces
[
i
%
len
(
namespaces
)]
.
Name
rcNameToNsMap
[
name
]
=
nsName
go
createRunningPodFromRC
(
&
wg
,
c
,
name
,
nsName
,
imageutils
.
GetPauseImageName
(),
additionalPodsPrefix
,
cpuRequest
,
memRequest
)
time
.
Sleep
(
200
*
time
.
Millisecond
)
}
wg
.
Wait
()
latencyPodStartupPhase
.
End
()
latencyMeasurementPhase
:=
testPhaseDurations
.
StartPhase
(
801
+
latencyPodsIteration
*
10
,
"pod startup latencies measurement"
)
defer
latencyMeasurementPhase
.
End
()
By
(
"Waiting for all Pods begin observed by the watch..."
)
waitTimeout
:=
10
*
time
.
Minute
for
start
:=
time
.
Now
();
len
(
watchTimes
)
<
watchTimesLen
+
nodeCount
;
time
.
Sleep
(
10
*
time
.
Second
)
{
if
time
.
Since
(
start
)
<
waitTimeout
{
framework
.
Failf
(
"Timeout reached waiting for all Pods being observed by the watch."
)
}
}
for
node
,
count
:=
range
nodeToLatencyPods
{
if
count
>
1
{
framework
.
Logf
(
"%d latency pods scheduled on %s"
,
count
,
node
)
nodeToLatencyPods
:=
make
(
map
[
string
]
int
)
for
i
:=
range
latencyPodStores
{
for
_
,
item
:=
range
latencyPodStores
[
i
]
.
List
()
{
pod
:=
item
.
(
*
v1
.
Pod
)
nodeToLatencyPods
[
pod
.
Spec
.
NodeName
]
++
}
for
node
,
count
:=
range
nodeToLatencyPods
{
if
count
>
1
{
framework
.
Logf
(
"%d latency pods scheduled on %s"
,
count
,
node
)
}
}
}
latencyMeasurementPhase
.
End
()
By
(
"Removing additional replication controllers"
)
podDeletionPhase
:=
testPhaseDurations
.
StartPhase
(
802
+
latencyPodsIteration
*
10
,
"latency pods deletion"
)
defer
podDeletionPhase
.
End
()
deleteRC
:=
func
(
i
int
)
{
defer
GinkgoRecover
()
name
:=
additionalPodsPrefix
+
"-"
+
strconv
.
Itoa
(
podIndexOffset
+
i
+
1
)
framework
.
ExpectNoError
(
framework
.
DeleteRCAndWaitForGC
(
c
,
rcNameToNsMap
[
name
],
name
))
}
workqueue
.
Parallelize
(
25
,
nodeCount
,
deleteRC
)
podDeletionPhase
.
End
()
}
close
(
stopCh
)
for
i
:=
0
;
i
<
len
(
namespaces
);
i
++
{
nsName
:=
namespaces
[
i
]
.
Name
...
...
@@ -914,18 +936,6 @@ var _ = SIGDescribe("Density", func() {
framework
.
ExpectNoError
(
framework
.
VerifyLatencyWithinThreshold
(
podStartupLatencyThreshold
,
podStartupLatency
.
E2ELatency
,
"pod startup"
))
framework
.
LogSuspiciousLatency
(
startupLag
,
e2eLag
,
nodeCount
,
c
)
latencyMeasurementPhase
.
End
()
By
(
"Removing additional replication controllers"
)
podDeletionPhase
:=
testPhaseDurations
.
StartPhase
(
820
,
"latency pods deletion"
)
defer
podDeletionPhase
.
End
()
deleteRC
:=
func
(
i
int
)
{
defer
GinkgoRecover
()
name
:=
additionalPodsPrefix
+
"-"
+
strconv
.
Itoa
(
i
+
1
)
framework
.
ExpectNoError
(
framework
.
DeleteRCAndWaitForGC
(
c
,
rcNameToNsMap
[
name
],
name
))
}
workqueue
.
Parallelize
(
25
,
nodeCount
,
deleteRC
)
podDeletionPhase
.
End
()
}
cleanupDensityTest
(
dConfig
,
testPhaseDurations
)
})
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment