Friday, February 24, 2012

How to set affinity for SqlExpress ?

I am using "sp_configure" to set the affinity for SqlExpress. I am using 8-cpu machine. When i check configuration "affinity mask" is set 0 (meaning 1st cpu by default) and "affinity I/O mask" is set to 64(7th cpu). If i try to set "affinity mask" to any value other than 64(7th cpu), it thorws error and doesn't allow me to set affinity value.

Here is what i am doing.

"affinity I/O mask" is already set to 64(7th cpu).

sp_configure 'show advanced options', 1;

RECONFIGURE;

sp_configure "affinity mask" , 128 setting affinity 8th cpu.

RECONFIGURE

If i run above statements it gives error like SqlExpress can't run on more than one cpu.

if i set the "affinity mask" to 64, it doesn't give any error but it doesn't work as expected. Am i missing something or doing something wrong ?

SQL Server 2005 Express use only one CPU.

http://blogs.msdn.com/czhower/archive/2006/01/06/510192.aspx

|||

Agreed - SQL Express only uses one CPU. But how does one set up express to always use lets say processor 6 ?

Regards,

Avinash

|||

Are you restarting SQL Server after making the change?

Apparently SQLExpress requires that.

http://msdn2.microsoft.com/en-us/library/ms187104.aspx

|||

Yes - but I guess my troubles are different. Let me try and clarify.

By default the I/O affinity mask is set to 64 and affinity mask to 0.

Lets say I want express to use processor 7 and so I will need to update affinity mask to 64. But then there seems to be a rule that disallows both the i/o affinity and processor affinity to be set to the same processor. So the run time value may never be set to 64 even with the Configure with override option. But you cant also change the affnity on the I/O mask because sql express only supports one processor.

Seems like a catch 22 situation to me. Ofcourse I may be missing something here.

Thanks,

Avinash

|||
Does appear to be a conundrum.

Both affinity I/O mask and affinity mask should be 0 by default.
Not sure why you're getting 64 on the affinity I/O.

Are you getting any messages in the SQL Error Log?|||

Lemme check. Dont remember seeing any though.

Thanks,

Avinash

No comments:

Post a Comment