-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
container/libcontainer: Improve limits file parsing perf
Only max open files is ever parsed from limits files, therefore this change optimizes for that case. Benchmark: ``` $ benchstat old.txt new.txt goos: linux goarch: amd64 pkg: github.com/google/cadvisor/container/libcontainer cpu: AMD Ryzen 5 3400GE with Radeon Vega Graphics │ old.txt │ new.txt │ │ sec/op │ sec/op vs base │ ProcessLimitsFile-8 85.012µ ± 1% 1.324µ ± 0% -98.44% (p=0.000 n=10) ``` On a GKE v1.27.4 production cluster, this code path used roughly 1.5% of the total kubelet CPU usage, and at 98.44% improvement this likely results in at least a 1.5% CPU reduction (perhaps even more since also less garbage is produced to be collected by the GC).
- Loading branch information
Showing
2 changed files
with
46 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters