SQL - Virtualized - Cores
Good Morning,
So, I'm a Systems Engineer. Not a DBA, although, I'm not a total dummy with regards to SQL...combined with my google-fu, I can get around in SQL, but don't ask me to write a SQL script, LOL!
We're having a rather heated debate with our SQL DBAs. They want 4 cores in there VM template, meaning, every future SQL server we spin up, will have 4 cores regardless of it's workload. I say bad idea! A VM that doesn't need 4 cores, shouldn't get 4 cores. An over-provisioned VM will have a negative performance impact on the host it sits on. I can cite sources on this.
I have one DBA insisting that SQL runs optimally on 4 cores because, 1 core is exclusively used for this, and 1 core is used exclusively for that, and the 3rd core is used exclusively for this other thing, leaving 1 core for Misc. I've spent the last 30 minutes trying to find documentation on that assertion but came up empty. Can anyone find a link and provide it to me?
Can anyone comment and cite your source on what's a good practice?
9 comments · 89% upvoted · other discussions
If you're managing the VM platform SQL Server is running on, you must read this whitepaper from VMWare. I don't know if Microsoft has one for Hyper-V, but a lot of the advice in the VMWare document should apply to Hyper-V as well.
The number of CPU cores (virtual or otherwise) will have an impact on performance. SQL Server will split a single expensive query into multiple parallel threads if it can, but only if you have multiple CPU cores available. This can be the difference between a query running in 9 seconds and 90 seconds.
If the workload is primarily single-threaded, you may be able to get away with less. But you have to be careful there and may find yourself adding vCPUs anyway. And if you're doing things beyond the SQL Server engine itself (SSRS, SSIS, etc.) you'll have higher CPU requirements as well because everyone is fighting for the same resources.
I don't think that's true, but they're not wrong that a production SQL Server can't skate by on a single CPU. I don't think I've ever run a production or even dev/test instance on fewer than 4 CPUs, but for a very light workload you may be able to get by on two.