1 / 11
Apr 2020

hi all,

i want to see how many threads i have on my centos 7 vm

root@lon-p-rtmp02:~# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0,1
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 2

so does that mean i have 4 threads?

thanks,

rob

No, you have two. It’s showing two online CPU. Could be two virtual CPUs if you are looking at a VM. You didn’t include the rest of the lscpu info to determine that.

You are showing 2 CPUs configured in 2 sockets. Each socket has 1 core and each core has 1 thread.

2 * 1 * 1 = still 2.

I’m guessing it’s a VM you’re dealing with.

sorry Gerard

root@lon-p-rtmp02:~# lscpu
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 2
On-line CPU(s) list: 0,1
Thread(s) per core: 1
Core(s) per socket: 1
Socket(s): 2
NUMA node(s): 1
Vendor ID: GenuineIntel
CPU family: 6
Model: 85
Model name: Intel(R) Xeon(R) Silver 4214 CPU @ 2.20GHz
Stepping: 7
CPU MHz: 2200.000
BogoMIPS: 4400.00
Hypervisor vendor: VMware
Virtualization type: full
L1d cache: 32K
L1i cache: 32K
L2 cache: 1024K
L3 cache: 16896K
NUMA node0 CPU(s): 0,1

but i swear cpus nowadays have 2 threads per core

Yes, your actual physical CPU (the Silver 4214) has 2 threads per core. 12 cores, 24 threads.

In your VM that is not necessarily true. It depends on your VM’s configuration.

When you create your VM you configure how many total cores you want to present to the VM and how many sockets to emulate as this may have an impact on (mostly Microsoft) licensing if something is licensed per-core or per-socket.

It looks like you gave that VM 2 CPUs cores and configured it for 2 sockets, so one thread per core/socket so that the total computing threads is at “2”.

yes in the cpu configuration of vmware i gave it 2 cpus bu i noticed something below

cpus.png

i should had really given it 2 cores per one socket not 1 core per 2 sockets

It’s virtualized. I’m 99.5% sure it will not matter for you. And if you do feels it matter, just change it. Power down the VM, change the configuration, power it back up.

I know that it’s already answered, but you could run htop and visually see how many threads

Or you could cat /proc/cpuinfo | grep -i processor

Or use the nproc command

Any of those should give a straight forward answer

It is much less efficient to have two sockets with one core each - than - one socket with two cores. It requires a lot more overhead for your processing. You should always use one socket for each VM and allot how many cores you want for it.

Here are the nitty gritty details on virtual CPUs, cores, sockets and NUMA in VMware. It’s a long read. Most people probably don’t care about these nuances.

thanks guys!!!

how many cores/threads do you think i need to transcode a 1080p stream

do you think 2 cores/threads will be good enough or 4 maybe?


Daily Challenge: Do you know the answer?
How are monitor sizes measured?