20122012. 1. 30. 10:04

Windows Server 에서 HyperThread  사용 여부를 확인하고 싶을 때가 있습니다. 3rd party 툴을 사용하지 않고 쉽게 WMI 쿼리를 사용하여 확인하는 방법입니다. 
 
Windows Server 2008 이상 버전에서는 WMI 쿼리를 사용하는 MSINFO32 의 실행 결과로 볼 수 있습니다만 직접 WMI 쿼리를 통해 결과를 확인하고 싶다면 아래 방법을 사용해 볼 수 있습니다. 


[실행방법] 
시작 - 실행 - CMD.EXE

C:\> wmic path Win32_processor get NumberOfCores, NumberOfLogicalProcessors

 
사례1
2 Core / HyperThread 를 사용하기 때문에 Logical Processors 가 4개로 나타납니다.


사례2
4 Core / HyperThread 사용하지 않기 때문에 Cores 와 Logical Processors 동일합니다.

 


아쉽게도... Windows Server 2003, Windows XP, and Windows 2000 운영체제는 NumberOfCores, NumberOfLogicalProcessors 속성을 지원하지 않습니다. (덧글에 있는 hotfix 참고)

추가적으로 SQL Server 가 설치되어 있다면 다음 쿼리를 통해 CPU 정보를 확인할 수 있습니다.

select cpu_count, hyperthread_ratio, cpu_count/hyperthread_ratio as 'sockets' from sys.dm_os_sys_info



[실행결과]
6 Core CPU 를 소켓에 2개 꽂아 사용하며 하이퍼스레드 기능을 사용한다면 아래와 같은 결과가 나타날 수 있습니다.

cpu_count   hyperthread_ratio  Sockets
----------- ----------------- -----------
24              12                        2 

/*
cpu_count(전체 논리적 CPU 개수)
hyperthread_ratio(하나의 물리적 CPU에 있는 논리 혹은 물리적 CPU 개수)
sockets(소켓 개수)
*/



SQL Server 2012 RC0 버전에서는 CPU 정보가 errorlog 에 상세하게 기록되는 것을 확인할 수 있습니다. (예)

SQL Server detected 1 sockets with 1 cores per socket and 1 logical processors per core, 1 total logical processors; using 1 logical processors based on SQL Server licensing.

 


[참고자료]
Win32_Processor class
http://msdn.microsoft.com/en-us/library/windows/desktop/aa394373(v=vs.85).aspx

sys.dm_os_sys_info
http://msdn.microsoft.com/en-us/library/ms175048(v=sql.90).aspx


작성자 : Lai Go / 작성일자 : 2012.01.30

Posted by Lai Go