Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [day] [month] [year] [list]
Date: Thu, 20 Jan 2022 11:47:24 +0800 (CST)
From: 段光辉 <badwolf09950@....com>
To: musl@...ts.openwall.com
Subject: Apine container can not get correct host cpu.

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


    


Content of type "text/html" skipped

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.