View Full Version : Core i7 Affinity
Sydwayz
12-16-2008, 07:40 PM
I am currently boxing 5 wow accounts with 1 main account and 4 slaves on 1 account on a single raptor HD.
I am running them symlinked. My questions is that with the new Core i7 920 what is the best affinity to set the two different accounts to?
My current affinity is 5 on the main and 10 on the slaves... At least that was what worked best for me with my q6600 but now with this new processor does it even matter. What should I do.
Also I am getting about a 57% load on core 0 and on cores 1-3 i am getting about 20-28% load when boxing.
Thanks for the help.
cairnz
12-16-2008, 08:56 PM
I tried this out a bit using a Q9450 and 5 clients.
The optimal results for me was to let the OS decide the core to run each client on, and also change the ProcessAffinityMask in config.wtf to 15 (which allows it to use any two of four cores).
http://forums.worldofwarcraft.com/thread.html?topicId=1778017311
Freddie
12-16-2008, 09:50 PM
I am currently boxing 5 wow accounts with 1 main account and 4 slaves on 1 account on a single raptor HD.
I am running them symlinked. My questions is that with the new Core i7 920 what is the best affinity to set the two different accounts to?
My current affinity is 5 on the main and 10 on the slaves... At least that was what worked best for me with my q6600 but now with this new processor does it even matter. What should I do.
Also I am getting about a 57% load on core 0 and on cores 1-3 i am getting about 20-28% load when boxing.
Thanks for the help.
If Blizzard still restricts the client to two cores then it might matter a lot, especially if you have hyperthreading on. I suggest testing by setting the affinities manually after your WoWs are running. You can do this with the operating system or (more conveniently) with a third-party program like HotkeyNet. You could compare these two schemes as well as the default scheme and see which of the three gives best results.
Both schemes assume hyperthreading is on.
WoW 1 on cores 0 and 4
WoW 2 on cores 1 and 5
WoW 3 on cores 2 and 6
WoW 4 on cores 3 and 7
WoW 5 on cores 3 and 7
-- or --
Every WoW on all eight cores
Microsoft article about setting affinity on hyperthreaded cpu's:
http://msdn.microsoft.com/en-us/magazine/cc300701.aspx
turbonapkin
12-17-2008, 12:15 AM
I have tried the following on a 920, the observations have been made during the high load scenarios of AV and the new Wintergrasp where you might have up to 30 people fighting in a small space.
No affinity set - Load stacks up primarily on 0 and 1, to the point of saturation on 1. Many cpu intensive scenarios stutter and become unplayable.
Affinity set 01,23,45,67 - Much better performance but still not ideal (I'm not clear on which cores are physical and which are virtual in the process manager. Pairing physical and ht cores may be important?)
Affinity set 01234567 across all four clients - Best performance of the three I have tried, however the second core does still seem to take a higher load than the others.
I am still not entirely happy with the performance in high load situations, I will try the other configurations mentioned and report back.
Freddie
12-17-2008, 01:06 AM
No affinity set - Load stacks up primarily on 0 and 1, to the point of saturation on 1. Many cpu intensive scenarios stutter and become unplayable.
This is consistent with reports that Wow sets itself by default to run on just two cores. Obviously this is bad for multiboxers.
I'm not clear on which cores are physical and which are virtual in the process manager. Pairing physical and ht cores may be important?
When hyperthreading is enabled, all these cores that you assign when you set affinity are "logical" cores. They correspond to physical cores as follows:
Logical 0 and 4 are both on the first physical core.
Logical 1 and 5 are both on the second physical core.
Logical 2 and 6 are both on the third physical core.
Logical 3 and 7 are both on the fourth physical core.
As for pairing, that's a good question, and that's the main reason why Windows allows us to set affinity. The main issue in pairing is cache. 0 and 4 share all levels of cache, same with 1 and 5, etc. Therefore it's usually a good idea to set a process to 0 and 4 before adding a third core, or to 1 and 5, or to 2 and 6, etc.
Affinity set 01234567 across all four clients - Best performance of the three I have tried, however the second core does still seem to take a higher load than the others.
I would expect this to be the best because when you set it this way, you're telling the thread scheduler (which is an incredibly important part of Windows), "you have maximum freedom to optimize the load on the CPU however you think is best. " Microsoft has spent millions and millions of dollars over many years optimizing and fine tuning the thread scheduler -- it's probably one of the most carefully written pieces of software in the history of computers -- and it seems incredibly unlikely to me that WoW players could do a better job by throwing a couple of static numbers in a config file than this extraordinary piece of software can do dynamically while the system is running. And yet -- until we test, we don't know. :)
As for the second core taking a higher load, I think this is because the thread scheduler tends to keep threads that belong to the same process on the same core. This minimizes cache misses. In other words, the scheduler is probably juggling cache issues vs. load balancing. But I'm only guessing. So far as I know, Microsoft has never documented the thread scheduler's algorithm. In fact they say repeatedly in their documentation that "A thread is normally scheduled to execute on any available logical CPU in the system. " (That's a quote from the article I linked above.) But as you saw, the thread scheduler was favoring core 2 for some reason. Probably if core 2 became saturated the scheduler would shift some of core 2's threads elsewhere.
I am still not entirely happy with the performance in high load situations, I will try the other configurations mentioned and report back.
Great! Looking forward to hearing more.
Clanked
12-17-2008, 04:59 AM
Is having a core being used 99% really a bad thing if the schedular is as good as you say?
Please correct me if I have 0 grasp of whats going on, but it sounds to me like they are doing this:
First core is left with a little leg room for whatever task might pop up before it has a chance to swap them over.
Second core is filled doing all the work it can. Everything that the second core can't handle, gets spread amongst the rest.
100% usage is only a problem if something is not getting done, due to not being able to get its cycles completed. If those cycles are handed to another core, is there a problem?
Freddie
12-17-2008, 05:25 AM
Therefore it's usually a good idea to set a process to 0 and 4 before adding a third core, or to 1 and 5, or to 2 and 6, etc.
I thought some more about that and I want to take it back. Microsoft's white paper on hyperthreading advises that with some threads it's better to run them together on one physical core so they can share cache. But with other threads that stall for the same reasons, it's better to run them on separate physical cores. However that advice is about setting affinities for individual threads. As users we aren't allowed to set affinities for individual threads. We're only allowed to set affinity for processes (groups of threads). When I wrote that I was trying to think how to apply this advice about threads to whole processes. On second thought I think it's probably better with a whole application like WoW to test it both ways and see what works better for it. I.e. for an individual WoW try 0+1 vs 0+4. For multiboxed WoWs try 0+1, 2+3, 4+5, 6+7 vs 0+4, 1+5, 2+6, 3+7.
Microsoft white paper on hyperthreading:
http://www.microsoft.com/whdc/system/sysinternals/ht-windows.mspx
Freddie
12-17-2008, 06:51 AM
Please correct me if I have 0 grasp of whats going on, but it sounds to me like they are doing this...
We can open Task Manager and look at the CPU graphs and see what they're doing. For example, the PC I'm using has two physical cores and it's extremely lightly loaded (overall about 2 percent) but even so, the graphs show that the scheduler is dividing the load between the two cores. If you check your own PC, I think you'll find the same thing under most conditions.
100% usage is only a problem if something is not getting done, due to not being able to get its cycles completed. If those cycles are handed to another core, is there a problem?
Yes but the scheduler isn't only concerned with avoiding problems. It's designed to maximize performance. It's not good enough that everything gets done. The goal is to get everything done as quickly as possible. This means minimizing the amount of time that threads have to wait before they can run, etc.
Clanked
12-17-2008, 08:30 AM
I was referring to "however the second core does still seem to take a higher load than the others."
I never said they were waiting to be executed, it just makes it seem like it will fill core 2, then offload to the rest.
turbonapkin
12-17-2008, 11:30 AM
Took some screenies while playing. Each one was taken during high load in AV. Obviously there's no science in this, but as an indication to those that are interested:
Affinity 01-23-45-67 (Plays well):
http://img512.imageshack.us/img512/1672/01234567mq2.jpg
Affinity 04-15-26-37 (also plays well):
http://img98.imageshack.us/img98/4779/04152637kv4.jpg
No Affinity (This was nasty and not playable)
http://img134.imageshack.us/img134/1844/noaffinityem9.jpg
Incidentally, after 2 hours of playing and recording these results I noticed that memory usage was extremely low on all clients:
http://img101.imageshack.us/img101/3923/memoryusageyt5.jpg
I had thought I would need to uprgade from 6GB of triple channel to 12GB based on my experiences with a Core 2 Duo system with 4GB but apparently not (unless I want to turn off my paging file, which I may do in the future).
If you want me to run any other affinity combinations let me know.
Freddie
12-17-2008, 12:32 PM
I never said they were waiting to be executed...
I mentioned threads waiting to be executed not because you said it, but because I was giving you an example of something that the scheduler is concerned with that does not involve reacting when a core gets close to 100% saturation.
...it just makes it seem like it will fill core 2, then offload to the rest.
I understood that it seemed that way to you. I was trying to explain that in fact, as a general rule, the thread scheduler doesn't do that. And I was also trying to give you an example of why it doesn't do that.
Freddie
12-17-2008, 12:54 PM
Obviously there's no science in this...
Very interesting, thanks. I don't know how deeply you want to get into this, but in addition to Task Manager, Windows includes a much more sophisticated program for this kind of analysis. It's called PerfMon. If you use PerfMon you *can* make this science.
If you want me to run any other affinity combinations let me know.
How about graphs for every WoW on all eight cores?
What would also be nice to see -- but this would involve more work -- would be an indication of performance to go along with the affinity setting. You (or somebody) could use Fraps or PerfMon for this.
If you want to get into this more deeply, here's a document about performance tuning from Microsoft that gives some ideas:
http://www.microsoft.com/technet/prodtechnol/windows2000serv/reskit/iisbook/c05_using_perfmon_to_monitor_processor_activity.ms px?mfr=true
I had thought I would need to uprgade from 6GB of triple channel to 12GB based on my experiences with a Core 2 Duo system with 4GB but apparently not (unless I want to turn off my paging file, which I may do in the future).
I'm skeptical that turning off paging can ever be a good idea. The first things I'd do to reduce paging is turn off services and get more RAM.
The document I just linked has a section about memory.
Creazil
12-17-2008, 02:02 PM
EDIT: The screenshots were taken at the same location in wow, without moving or anything - In Dalaran with ALOT of people around, if it matters anything.
I made some tests aswell, one with all 8 as you suggested. I had focus on the main, which then gets a max fps of 40 and the slaves 15 fps. The main would be in "01" in the second screenshot and "04" in the third. I didn't bother with "no affinity", cause that just sucks :-)
8 cores:
http://www.hdimage.org/images/s14hdnu1cgfqd7nd9fn_8cores.bmp
Second core and last core seems to work a little more than the others.
01234567:
http://www.hdimage.org/images/0u1o2cnnovbfiuqyk4d_01234567.bmp
The "main" cores is working more, but the second of the 2 cores is working craazy!
04152637:
http://www.hdimage.org/images/h4nri6gniyos0anoifvh_04152637.bmp
Same as 2 pretty much!
The first solution works best, imo :-)
Creazil
12-17-2008, 02:06 PM
Compared to the other screenshots, by turbonapkin, it seems like I use alot more memory :-)
Freddie
12-17-2008, 02:33 PM
I made some tests aswell, one with all 8 as you suggested.
Thanks. The thing that jumps out at me about that screenshot is how even the load is. Would you agree that it's the most even screenshot so far? It's also the only screenshot where the operating system is completely free to schedule WoW's threads however it wants. In all the other screenshots, the operating system is artifically constrained by the affinity setting. I think this shows what I was trying to say to Clanked, that the thread scheduler tends to distribute loads pretty evenly.
I just want to make sure I understand your other numbers. When you say 01234567, do you mean WoW1 is on 0 and 1, WoW2 is on 2 and 3, etc.?
The first solution works best, imo :-)
This will be very helpful for people to know.
Freddie
12-17-2008, 02:39 PM
Could one of you check something? Launch four WoWs from scratch without setting the affinity manually in any way (including not in WoW's config file). Then open the operating system's Set Affinity box to see how WoW sets its own affinities by default. From what we've seen it seems like they will all be set to 0 and 1 but it would be good to know for sure.
turbonapkin
12-17-2008, 02:45 PM
Yes, all instances are set to 0 and 1 if you just launch the clients in a normal fashion.
I've been playing with perfmon and a log analyser called PAL, once I have found a way of preesnting the results in a way that may be of some use here I will post back or maybe make a new thread as I don't want to divert from the OP.
Freddie
12-17-2008, 03:31 PM
Compared to the other screenshots, by turbonapkin, it seems like I use alot more memory :-)
I just looked for a few minutes to try to find an easy way to judge whether WoW is starved for memory. (I'm looking on Vista.) If you click "Resource Monitor" at the bottom of Task Manager's Performance tab, then expand the memory bar on Resource Monitor, you can see hard page faults per minute for each WoW. That's the number of times the application had to stop what it's doing and retrieve a piece of info from disk because it had been paged out of memory. Ideally that number would always be zero. You can measure the same thing over a longer period of time with PerfMon.
Creazil
12-17-2008, 06:44 PM
I just want to make sure I understand your other numbers. When you say 01234567, do you mean WoW1 is on 0 and 1, WoW2 is on 2 and 3, etc.? Yes.
Yes, all instances are set to 0 and 1 if you just launch the clients in a normal fashion. That's the same for me :-)
Could one of you check something? Launch four WoWs from scratch without setting the affinity manually in any way (including not in WoW's config file). How do you do that? - the thing in bold! :-)
As for my performance in general. I am running around with 40 fps in Dalaran on the main (15 fps on slaves), full view distance, full spell details, and full environmental details!
Creazil
12-17-2008, 06:58 PM
Compared to the other screenshots, by turbonapkin, it seems like I use alot more memory :-)
I just looked for a few minutes to try to find an easy way to judge whether WoW is starved for memory. (I'm looking on Vista.) If you click "Resource Monitor" at the bottom of Task Manager's Performance tab, then expand the memory bar on Resource Monitor, you can see hard page faults per minute for each WoW. That's the number of times the application had to stop what it's doing and retrieve a piece of info from disk because it had been paged out of memory. Ideally that number would always be zero. You can measure the same thing over a longer period of time with PerfMon.Ah, neat - it's zero so no problem :-) I've been looking a little at perfmon, i'll check it out tomorrow!
Sydwayz
12-17-2008, 10:16 PM
Thank you all for your help.
I am also getting the best results from setting affinty for all accounts to all 8 cores.
Is there a way to set that in the config.wtf file like we used to?
What would be the processaffinity number for all 8 cores?
Thanks again
Freddie
12-17-2008, 10:29 PM
If the setting works as described in the link at the top of this thread, the number would be 255. You can test to see if it works by putting that number in the config file, starting WoW, opening Task Manager, selecting Processes, right-clicking WoW, selecting Set Affinity, and looking at the Processor Affinity window to see whether WoW has set itself to run on all CPUs.
(Those are instructions for Vista; XP might be a little different.)
Creazil
12-18-2008, 06:21 AM
If the setting works as described in the link at the top of this thread, the number would be 255. You can test to see if it works by putting that number in the config file, starting WoW, opening Task Manager, selecting Processes, right-clicking WoW, selecting Set Affinity, and looking at the Processor Affinity window to see whether WoW has set itself to run on all CPUs.
(Those are instructions for Vista; XP might be a little different.)255 worked for me, on a vista system :-)
larifari
12-18-2008, 07:28 AM
I bought me a new q6600 and i set the config on "15", but now i get in Alterac over 85% CPU usage on all 4 cores - nearly all the time, can someone tell me if this is normal ??
Bovidae
12-18-2008, 03:39 PM
I bought me a new q6600 and i set the config on "15", but now i get in Alterac over 85% CPU usage on all 4 cores - nearly all the time, can someone tell me if this is normal ??This is normal
Nairi
12-19-2008, 02:56 PM
I just want to make sure I understand your other numbers. When you say 01234567, do you mean WoW1 is on 0 and 1, WoW2 is on 2 and 3, etc.? Yes.
Yes, all instances are set to 0 and 1 if you just launch the clients in a normal fashion.
That's the same for me :-)
Could one of you check something? Launch four WoWs from scratch without setting the affinity manually in any way (including not in WoW's config file). How do you do that? - the thing in bold! :-)
As for my performance in general. I am running around with 40 fps in Dalaran on the main (15 fps on slaves), full view distance, full spell details, and full environmental details!System specs please!
So your getting 40+ on main and 15+ on each slave(4)? and in dalaran!????
ThisIsDrakul
07-13-2009, 06:50 AM
I am now looking at setting affinity, I did search and found this thread.
Brilliant thread....great example of how good this community can be...I cannot imagine anywhere else that the combination of knowledge, experience and real-life testing would come together
Would be good to include some/all of this in the wiki
Thanks to all the contributors in this thread
Bovidae
07-13-2009, 03:20 PM
Thank you for the /bump
Freddie
07-13-2009, 09:45 PM
So far as I know, Microsoft has never documented the thread scheduler's algorithm.
I don't remember what I was thinking when I wrote that but there is actually quite a bit of info about this in "Windows Internals," a standard reference book published by Microsoft Press. (Pages 391-450 of the fifth edition.)
http://www.amazon.com/Windows%C2%AE-Internals-Including-Windows-PRO-Developer/dp/0735625301
I read all the 3 Site..but as an foreigner..i understand not all..maybe someone has a few seconds,and can tell me what now the best ? Which affinity re works best?
Freddie
08-29-2009, 04:15 PM
I read all the 3 Site..but as an foreigner..i understand not all..maybe someone has a few seconds,and can tell me what now the best ? Which affinity re works best?
You can set every WoW to all cores. That allows the operating system to optimize core assignments. This solution may not be the best but it's close to the best and it's easy.
vBulletin® v4.2.2, Copyright ©2000-2025, Jelsoft Enterprises Ltd.