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.


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`


What happens when you type the following:

[user@host]$ getconf _NPROCESSORS_ONLN


  • 1
    getconf _NPROCESSORS_ONLN returning to 1 – Abhik Bose Nov 27 '17 at 19:38
  • As anticipated it is showing the one (1) you have avail. Are you familiar with containers? If you'd like to learn more, I suggest reading: en.wikipedia.org/wiki/OpenVZ – kilrainebc Nov 27 '17 at 19:53
  • More than happy! :) Good luck! – kilrainebc Nov 27 '17 at 20:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.