diff options
author | Lingfu <shanks.cyp@gmail.com> | 2018-09-19 13:34:28 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2018-09-19 13:35:42 -0700 |
commit | f0a92b6b67382a1f8da5ef2622c59afdb1c40f13 (patch) | |
tree | 451879158e08d1ad8d08782353e8d95c752ac208 /runsc/specutils/BUILD | |
parent | bd12e952479dead5adc84a611ee21ab76ce1b100 (diff) |
Add docker command line args support for --cpuset-cpus and --cpus
`docker run --cpuset-cpus=/--cpus=` will generate cpu resource info in config.json
(runtime spec file). When nginx worker_connections is configured as auto, the worker is
generated according to the number of CPUs. If the cgroup is already set on the host, but
it is not displayed correctly in the sandbox, performance may be degraded.
This patch can get cpus info from spec file and apply to sentry on bootup, so the
/proc/cpuinfo can show the correct cpu numbers. `lscpu` and other commands rely on
`/sys/devices/system/cpu/online` are also affected by this patch.
e.g.
--cpuset-cpus=2,3 -> cpu number:2
--cpuset-cpus=4-7 -> cpu number:4
--cpus=2.8 -> cpu number:3
--cpus=0.5 -> cpu number:1
Change-Id: Ideb22e125758d4322a12be7c51795f8018e3d316
PiperOrigin-RevId: 213685199
Diffstat (limited to 'runsc/specutils/BUILD')
-rw-r--r-- | runsc/specutils/BUILD | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/runsc/specutils/BUILD b/runsc/specutils/BUILD index e73b2293f..f1a99ce48 100644 --- a/runsc/specutils/BUILD +++ b/runsc/specutils/BUILD @@ -5,6 +5,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test") go_library( name = "specutils", srcs = [ + "cpu.go", "namespace.go", "specutils.go", ], |