Commit dec8a56
authored
[History Server] Tune CPU, memory, and event logging for cold loads (#5095)
* [History Server] Fix cold-load CPU starvation and per-event logging
Loading a dead session is CPU-bound, but the sample manifest sets only
`limits.cpu: "500m"`, so Kubernetes pins requests there too and the load
saturates the quota for its entire duration. Measured on kind across 13 runs,
the container sat at 0.42-0.50 cores every time.
Raising the limit to 4 (requests stay at 500m, so scheduling cost is unchanged):
| tasks in session | 500m | 4 cores |
|---|---|---|
| 50,000 | 97.9s | 30.5s |
| 100,000 | 907.3s | 62.7s |
This also removes what looked like superlinear degradation past 50k tasks: at
500m the per-task cost went from 1.96ms to 9.07ms between 50k and 100k, while at
4 cores it is flat (0.61ms and 0.63ms). The load uses ~1.2 cores on average and
peaks at ~2.2, because Go's GC runs concurrently and needs cores of its own.
The second change drops the per-event log line in storeEvent to Debug. It runs
once per event, so a 100k-task session writes ~436,000 INFO lines per cold load,
and the binary never calls logrus.SetLevel, so there is no way to turn it off.
Worth ~13% of load time at 50k tasks (97.9s -> 85.3s).
* historyserver: leave CPU limit configurable
Signed-off-by: Future-Outlier <eric901201@gmail.com>
* historyserver: size sample memory for session cache
Signed-off-by: Future-Outlier <eric901201@gmail.com>
* historyserver: repair tests after cache changes
Signed-off-by: Future-Outlier <eric901201@gmail.com>
* historyserver: size example cache memory
Signed-off-by: Future-Outlier <eric901201@gmail.com>
* historyserver: document example memory sizing
Signed-off-by: Future-Outlier <eric901201@gmail.com>
---------
Signed-off-by: Future-Outlier <eric901201@gmail.com>1 parent b663dc3 commit dec8a56
4 files changed
Lines changed: 25 additions & 4 deletions
File tree
- historyserver
- config
- pkg/eventserver
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
49 | 53 | | |
50 | | - | |
| 54 | + | |
51 | 55 | | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
47 | 51 | | |
48 | | - | |
| 52 | + | |
49 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
68 | 72 | | |
69 | | - | |
| 73 | + | |
70 | 74 | | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
133 | 133 | | |
134 | 134 | | |
135 | 135 | | |
136 | | - | |
| 136 | + | |
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
| |||
0 commit comments