Sql-server – DB server VM’s CPU configuration – 1x2Ghz or 2x1Ghz – which is better

configurationhardwaresql server

We want to set up DB server in cloud hosting for MS SQL Server Express edition – OLTP workload for "just" 6 concurent users – mostly short and small transactions.

Hosting company is charging each 1Ghz of CPU. Concerning CPU configuration, would you go 1 x 2Ghz or 2 x 1Ghz (logical cores in VM)?

Similar question is answered here: CPU clock speed versus CPU core count – higher GHz, or more cores for SQL Server?

My question is a bit different / specific in a way I'm choosing between just one core with higher speed or two with lower speed. So the scale is far different.

Best Answer

My question is a bit different / specific in a way I'm choosing between just one core with higher speed or two with lower speed. So the scale is far different.

Technically, more cores is always better if either the software is multithreaded, or multi-process (workers). As far as the hardware is concerned

  • More cores means more instructions are processed at the same time.

    • including instruction fetching and decoding, execution, memory access (cached, or out to bus), writes. You can read more about this on Instruction pipelining
    • you have a different pipeline for each core.
    • each core can with a full pipeline do more than one thing at a time. Modern Intel CPUs post-Sandy Bridge have a 14 stage pipeline.
  • Fewer cores, regardless of speed, mean fewer multi-stage pipelines to fill and fewer things can be done in parallel.

As far as the software side

  • Threads and processes can be managed by the kernel.
  • Most databases will run at the very least the WAL-log on another thread then the execution/query engine
  • Software that is multithreaded, will do very poorly on a single-threaded CPU.

For these reasons, the answer from the hardware and software side is clearly in favor of more cores (so long as your use case is provided for by the operating system and application as subject to Amdahl's law). Microsoft though isn't free, and brings to the table expensive licensing that needs to be factored into the total cost of ownership. This can tie your hands, but plays into the value of the product. As far as licensing requirements, check out this answer by Max.