Checking the CPU count from "cpu cores : " -line in /proc/cpuinfo is a wrong way to do it.
It reports just the amount of cpu-cores in one socket, therefore:
- it doesn’t take multiple sockets into account (can be detected from the ‘physical id’ -line)
- it doesn’t take multiple threads into account (can be detected from the ‘siblings’, if it differs from ‘cpu cores’)
–> ok, someone might hate simultaneous multithreading (hyper-threading) and wants just “the real cores”
For example, a physical machine with four Intel Xeon E7-4820v4 -processors has the following configuration:
4 sockets, 10 cores per socket, 2 threads per core = 40 physical cores, 80 threads in total.
“cpu cores” -line in /proc/cpuinfo says 10, quite suboptimal detection…
CPU topology under virtualization could be presented in many different ways. 8 vCPUs could be anything from “1 socket, 1 CPU/socket, 8 threads/CPU” to “8 sockets, 1 CPU/socket, 1 thread/CPU” and the software should be able to detect all the different options - because usually you don’t get physical CPU:s pinned only for your VPS, they are all shared.