MongoDB - Does WiredTiger benefit from virtual cpus cores the same way
it does with physical cores?
As per my understanding the MongoDB documents defines based on the physical cores.
As blog notes by @UmaPanda here this topic is always a perpetual debate to define the proper ratio of physical CPU to virtual CPU in virtualized environment.
First you understand the basic calculation:
The number of physical cores i.e. pCPU available on a host:
(# of processor Sockets) X (# of Cores) = # of Physical Processor (i.e pCPU)
The number of logical cores if hyper-threading is enabled on the host:
(# of Physical Processors i.e pCPU) x (2 cores) = # Virtual Processors (vCPU)
Total CPU resorces required for virtual machines at peak:
(# total number of virtual machines X average peak CPU utilization per system)
kindly note that hyper-threading does not actually double the available of Physical CPU. It works by providing a second execution thread to a processor core. So, a processor with 4 physical cores with hyper threading will appear as 8 logical cores for scheduling purpose only.
The WiredTiger storage engine is multithreaded and can take advantage
of additional CPU cores.
The MongoDB document also states that here Specifically, the total number of active threads (i.e. concurrent operations) relative to the number of available CPUs can impact performance:
Throughput increases as the number of concurrent active operations
increases up to the number of CPUs.
Throughput decreases as the number of concurrent active operations
exceeds the number of CPUs by some threshold
amount.
The threshold depends on your application. You can determine the optimum number of concurrent active operations for your application by experimenting and measuring throughput. The output from mongostat provides statistics on the number of active reads/writes in the (ar|aw) column.
And also from MongoDB blog notes here MongoDB will deliver better performance on faster CPUs. So, one of the MongoDB performance best practices is that the core speed is more important than the number of cores.
For further your ref here , here , here and here