npm.io
1.0.3 • Published 4 years ago

get_cpus_length

Licence
ISC
Version
1.0.3
Deps
0
Size
2 kB
Vulns
0
Weekly
0
Stars
16

get_cpus_length

Get os.cpus().length to match Linux container CPU quota.

const getCpusLength = require("get_cpus_length");

+ console.log("CpusLength: ", getCpusLength());
- console.log("CpusLength: ", require("os").cpus().length);

Installing

NPM Version

npm install get_cpus_length

or

yarn add get_cpus_length

why

When your kubernetes is set up Resource Management for Pods and Containers, this problem occurs Not correct os.cpus().length inside the docker container with cpus limited. #28762.

Keywords