Using the Sys.dm_sys_info view is often confusing to the Hyperthread_ratio column. What is the meaning of this column?
Translation of an article of the foreign Great God, http://sqlblog.com/blogs/kalen_delaney/archive/2007/12/08/hyperthreaded-or-not.aspx
In my class or every time I do a performance consultant, I often get the question "How do I know if our SQL Server is Hyper-threading"?
When I found out that Dmv--sys.dm_sys_info had a column called Hyperthread_ratio (Super line turndown), I felt very happy. Soon after, I read one of my favorite SQL SERVER
Blogger Buck Woody a blog post. He points out that the following query tells us the number of CPU cores, rather than telling you whether Hyper-threading is turned on.
SELECT Cpu_count/hyperthread_ratio as sockets
From Sys.dm_os_sys_info
Although Buck says this statement tells us the number of cores, it's not true. Because a slot can contain a multi-core CPU. A cpu_count with a single-socket dual-core CPU and no Hyper-threading is 2,hyperthread_ratio is 2, while single-socket single-core and hyper-threaded computer hyperthread_ratio are also 2. In 2 cases, the Cpu_count/hyperthread_ratio is the number of slots. If we have a single slot, a dual-core CPU, and a hyper-threaded computer, Cpu_count will turn into 4.hyperthread_ratio is also 4, using this ratio is also 1, summarized as follows:
Number of Sockets |
Number of cores |
Hyperthreaded? |
Sys.dm_os_info. Cpu_count |
Sys.dm_os_info. Hyperthread_ratio |
Cpu_count/hyperthread_ratio |
1 |
2 |
NO |
2 |
2 |
1 |
1 |
1 |
YES |
2 |
2 |
1 |
1 |
2 |
YES |
4 |
4 |
1 |
So even though Buck says that this formula can tell us the number of cores, the query itself tells us that the result is "number of slots." Cpu_count/hyperthread_ratio will get the number of slots, not the number of cores. And there is no way to differentiate between dual-core and Hyper-Threading.
Is SQL Server Hyper-threading?