Help please!
I need to get number of CPU's and cores per cpu for each host server running SQL Server. Querying master.sys.dm_os_sys_info is not producing the same result as what is seen when checked on the host server.
kindly point me in the direction of a code I can use please.
What is the difference between physical_cpu and logical_cpu and which one do I need? I'm trying to calculate total cores on each machine for licensing purposes.
Can i take the number of cores returned by the query pasted below as what I need to calculate my license requirement?
In performance monitor on the server, I have sockets =2, Cores = 16, logical processors = 32. Is 16 cores what I need for my SQL 2012 and 2016 licence calculations?
Here the query that I'm using right now:
USE master;
SET NOCOUNT ON
SELECT 'physical_cpu' = cpu_count / hyperthread_ratio
,'cores' = CASE
WHEN hyperthread_ratio = cpu_count
THEN cpu_count
ELSE (cpu_count / hyperthread_ratio) * ((cpu_count - hyperthread_ratio) / (cpu_count / hyperthread_ratio))
END
,'logical_cpu' = CASE
WHEN hyperthread_ratio = cpu_count
THEN cpu_count
ELSE ((cpu_count - hyperthread_ratio) / (cpu_count / hyperthread_ratio))
END
FROM master.sys.dm_os_sys_info
Anything better than that?