Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ansible - procesor_count vs processor_cores vs processor_vcpus

I got puzzled setting up server with the following cpu facts:

"ansible_processor": [
    "GenuineIntel", 
    "Intel(R) Xeon(R) CPU E5-2650L v3 @ 1.80GHz", 
    "GenuineIntel", 
    "Intel(R) Xeon(R) CPU E5-2650L v3 @ 1.80GHz"
], 
"ansible_processor_cores": 1, 
"ansible_processor_count": 2, 
"ansible_processor_threads_per_core": 1, 
"ansible_processor_vcpus": 2, 

It seems to report the number of CPUs correctly but what should I base my workers (threads) number on? I was sure I'd use ansible_processor_cores but it seems to report only one (1 - sic!) despite reporting two processors! How do you get the number of threads available for worker processes?

like image 342
silverdr Avatar asked Sep 16 '16 20:09

silverdr


1 Answers

Looking into the code ansible_processor_vcpus should be your choice.
It should contain number of processors in /proc/cpuinfo (which actually is a number of total threads, as per this answer.

like image 106
Konstantin Suvorov Avatar answered Nov 06 '22 01:11

Konstantin Suvorov