Log in

View Full Version : How to set affinity manually for 8 cores



turbonapkin
01-22-2009, 09:58 AM
I've geared this post towards Keyclone users a little, but it is applicable to anyone who wants to manually control affinity for any number of cores.

A number of people have experienced issues with setting CPU affinity for processors containing more that four cores when using Keyclone. Currently Keyclone can set affinity for up to four cores on a core-per-client basis. If you want to set your affinity effectively for processors such as the Intel Core i7, or want to be able to spread client load across multiple CPU, you will need to manually set the processAffinityMask variable which can be modified in the %wowinstall%/wtf/config.wtf file.

I should note at this point that the Innerspace tool is capable of managing any affinity configuration and if you choose to use it, this information is not applicable. If you want to continue using keyclone commands, read on...

In order to translate your desired client affinity setup into the correct processAffinityMask it is most easily understood by representing each configuration as a binary number. In the table of examples below, each configuration is represented by the 8 bit string in the yellow columns where:

1 = Use this CPU
0 = Do not use this CPU

Each CPU is numbered as it is in the Windows Task Manager.

I have outlined some common examples rather than every possible combination. Those who are familiar with binary will note that the processAffinityMask is a decimal representation of the eight bits in the yellow columns.

http://img339.imageshack.us/img339/8536/79570274vg4.png

My personal preference at the moment is to set the mask to 3 for my master (use the first two CPU), 240 for my slaves (use the last four CPU) leaving 2 cores free for Windows to do whatever it wants with.

Once you have decided which affinities to use and have modified your config files you will need to make sure your Keyclone commands are setting CPU affinity to NONE otherwise your custom values will not work.

I am terrible at explaining things clearly so please ask if I have failed to explain something properly.

Freddie
01-22-2009, 11:25 AM
There was a thread recently where people tested various affinity settings on i7's and found that the fastest setting (assuming you have hyperthreading enabled) is 255 which gives Windows maximum freedom to schedule threads in whichever way it thinks it best:

Core i7 Affinity ('http://www.dual-boxing.com/forums/index.php?page=Thread&threadID=17526&pageNo=1')

Edit: Turbo I just realized you participated in that thread but are offering different advice here. Did you get new test results that changed your mind?

turbonapkin
01-22-2009, 12:22 PM
For a long time I ran with all clients at 255. This ran well for a period, but after introducing other things into the mix, by which I mean other directx instances, applications etc. I began to have issues with my clients choking.

I changed out to 255 for the slaves and 15 (first four cores) for the main and ran that config for a few weeks and again, found my experience smooth on all clients.

The choking returned when I started playing alot of h264 media in the background, which is considerably cpu intensive. I decided to try the setup I recommended in the OP, in order to offer the operating system some resources to play with and have had success with it thus far.

I would conclude at this point that my findings have been that spreading the load across all cores is a good move for your wow clients, but this has an adverse effect when adding a cpu-intensive application into the mix. The key, I believe, is hitting the affinity balance point between distributing wow client load and leaving enough readily available resource for the rest of the system.

Freddie
01-22-2009, 12:44 PM
I see, thanks for the info!

Creazil
01-22-2009, 01:02 PM
For a long time I ran with all clients at 255. This ran well for a period, but after introducing other things into the mix, by which I mean other directx instances, applications etc. I began to have issues with my clients choking.
I've experienced this aswell, sadly! I took the consequence and took all of my background applications, like music and other random things to another computer :)