4

I'm trying nproc and nproc --all in an OpenVZ container to count the number of CPU threads assigned to the vps by upstream provider. While nproc resulting 1, nproc --all resulting 24 CPU threads. May anyone please help me in explaining this?

The upstream provider is supposed to assign only one CPU and cat /proc/cpuinfo is also saying that. Then from where and how this 24 is coming?

Please find a screenshot here https://prnt.sc/hfzeuw. I'm using CentOS 7 inside the vps.

Abhik Bose
  • 2,090
  • 2
  • 15
  • 30

1 Answers1

3

They are using a 12 core proc with hyperthreading, most likely. They have assigned one of these threads to your container.

From the man page:

   nproc - print the number of processing units available

   nproc [OPTION]...

   --all  print the number of installed processors`

EDIT:

What happens when you type the following:

[user@host]$ getconf _NPROCESSORS_ONLN

?

Rui F Ribeiro
  • 55,929
  • 26
  • 146
  • 227
kilrainebc
  • 46
  • 3