March 14, 2007 at 12:50 pm
How to determine number of processors before an SQL Server is installed?
Your input will be greatly appreciated.
March 14, 2007 at 1:55 pm
there may be other ways, but i found this snippet on sqlteam:
-- Get the number of processors that the server has
declare @NumProcs int
EXEC master..xp_regread
@rootkey = 'HKEY_LOCAL_MACHINE',
@key = 'SYSTEM\CurrentControlSet\Control\Session Manager',
@value_name = 'RegisteredProcessors',
@value = @NumProcs OUTPUT
SELECT @NumProcs
SELECT convert(varchar,isnull(@NumProcs,'0')) + ' processors are installed on ' + isnull(@@servername,'local')
results on one of my better servers:
-----------
4
--------------------
4 processors are installed on local
Lowell
March 14, 2007 at 2:41 pm
Thank you very much for your input. But this script may not be able to provide a correct result. I ran it against my own PC. It returned 2, but my PC only has 1 processor in reality.
We can run master..xp_msver to retrieve the number of processors. However, how to retrieve the number of processors before an SQL Server is installed?
Many thanks once again.
March 14, 2007 at 4:43 pm
that registry entry i found is not accurate, you are right...my home machine, which is just a single processor AMD64 has a registry entry of EIGHT processors for that value...I'll poke around, so you are looking for a processor detection tool for machines on the network, and not necessarily SQL server instances, right?
Lowell
March 14, 2007 at 4:55 pm
ok poking around the registry, i found this key:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Environment\NUMBER_OF_PROCESSORS
now to read that from each machine on the network , i would simply create a program to read that key fromt he registry, and use psTools to runt he executable on every machine;
http://www.microsoft.com/technet/sysinternals/ProcessesAndThreads/PsTools.mspx
if you don't have code for reading the registry, I can send you something in vb6 or vb.NET to do it.
Lowell
March 15, 2007 at 3:58 am
exec
master..xp_msver processorCount
March 15, 2007 at 8:31 am
Adam:
The approach you recommended helps only after installing SQL Server. In reality, we can go to the Device manager to find the number of processors (I just confirmed it). The data from either registry or the task manager may not give us correct information. The information on the number of processors is important in licensing.
Many thanks for your input.
March 15, 2007 at 4:19 pm
Find wherever sysinfo.exe is on the C: drive and execute it from a cmd window... more information will appear than you could possibly use including the number, make, model, revision, and speed of the processor(s).
--Jeff Moden
Change is inevitable... Change for the better is not.
March 16, 2007 at 1:10 am
Unfortunately there is no easy way of doing that as multi-cored and hyper-threaded processors report themselves more than once. e.g if you have a new server with 4 dual-core processors, in the operating system you will see 4x2(cores)x2(hyper-threading)=16
In sql you should set the license for 4 procs, but as maxdop is concerned it should be 8
March 16, 2007 at 8:34 am
It also depends on your OS. Some can detect cores, some detect the threading (so hyperthreading on appears as 2).
Windows XP can detect multiple logical processors, but not physical ones. Windows 2003 does a better job, but I'm not sure if the new multi-core processors are detected properly.
The bottom line is that I'm not sure it matters for the software. With virtualization, multiple cores, etc., the human looking at the hardare or the BIOS might be the only good way of accurately counting CPU slots. Any configuration based on this should be done by the admin.
http://www.intel.com/cd/ids/developer/asmo-na/eng/200678.htm
March 16, 2007 at 9:23 am
Jeff:
sysinfo does not work if we have multi-thread.
Many thanks for your input.
Viewing 11 posts - 1 through 10 (of 10 total)
You must be logged in to reply to this topic. Login to reply