* [musl] Apine container can not get correct host cpu.
@ 2022-01-20 3:47 段光辉
0 siblings, 0 replies; only message in thread
From: 段光辉 @ 2022-01-20 3:47 UTC (permalink / raw)
To: musl
[-- Attachment #1: Type: text/plain, Size: 1005 bytes --]
Hello:
I'm using alpine docker images in Kubernetes. Kubernetes version: v1.19.5, OS: CentOS 7.4.1708, Linux kernel: 3.10.0 .
command `nproc` in container should be return the host cpu count(8 cores, 0-7), but when deployment in kubernetes set limits cpu equals requests cpu,like :
resources:
limits:
cpu: "1"
memory: 1Gi
requests:
cpu: "1"
memory: 1Gi
then `nproc` command return 1, not the host cpu count.
so, the program like java,python,go when get cpu cores will not be correct by methods sched_getaffinity or cpu_count,JVM (JDK8) may be crashed in container,jdk get min value between host and pod limit, method sched_getaffinity in container start from 1, not 0.
~ # apk info musl
musl-1.2.2-r7 description:
the musl c library (libc) implementation
musl-1.2.2-r7 webpage:
https://musl.libc.org/
musl-1.2.2-r7 installed size:
608 KiB
[-- Attachment #2: Type: text/html, Size: 2216 bytes --]
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-01-20 12:30 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-20 3:47 [musl] Apine container can not get correct host cpu 段光辉
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).