Processor Affinity? What is it?

Using processor affinity will enhance the performance of your computer and the programs you use.

Do you have a Core 2 Duo or Quad processor or multi processor motherboard in your computer?

Did you know that you can make a program run on one processor instead of all of them? In the computing world assigning a program or process scheduling to one processor is known as Processor Affinity.

How it works: 

When you start your computer all programs and processes are running on all available processors, if your system has two or more then the processors will 'share' the work load. This is not always the most efferent use of the processors, because the scheduling of the processes by the Operating System is not always the most efferent. By using the Task Manager you can see which processor is getting most of the work load.

Note: When the Operating System starts and loads services the affinity and priority are locked, that is you can not change the settings. With a registry hack (which I will not give you) or a special program the 'run at startup' services can be unlocked for their affinity settings. (See end of article for one such program).

In my experience and experimentation I have found that in a dual processor system the first processor (the '0' or zero processor) will have the heaviest work load. The skewing of the work load can be brought closer to equal with manual manipulation or with a program that is designed to set the Affinity (process scheduling) when the computer is started.

Processor Affinity Case in point:

When you start your computer after all the services and your normal everyday programs are running, open the task manager.

Go to the  performance tab, you need to see all of the processors, if you only see one 'CPU usage History'  window select 'View' then "One graph per CPU'. Now you can see the usage of each cpu in your computer. Which one has the highest work load?

You need this in your IT Tool Box! Get yours today...Imagine paying 10-20% more for this with the new EU VAT...
Get this NOW!

Next go to the Processes view, Look at the column for the CPU, this is the time the cpu is being used, in the left hand column is the 'Image name' this is the actual process that is running on the cpu. (Also check the box 'show processes for all users').

If you have a process that is using over 25% of the cpu time right click on the process and look at which cpu it is scheduled to run on, more than likely it will be all the processors.

At this time you can only change the affinity of the process of programs started by your user ID, not any services,  to one processor.

This means the process will only be scheduled on that processor. Think about this for a minute, if you have five programs that are getting 50% of the scheduled cpu time, then this one is getting 25% of the cpu time this leaves 25% for all the other processes.

Ideally you would want to have any processes that do not require a lot of scheduled process time to be on one processor. These processes are your services, small programs like notepad, and any explorer windows you have open for access to documents.

Programs like your email, word processors, especially spreadsheet or data base programs should be on one of the other processors. Microsoft SQL (Sequel) Server is recommended to run on one or more processor by itself!

Processor Affinity screen shots:

CPU History Graph.                                                CPU Time usage and Image Name.
Task manager, CPU history graph, note the TWO usage graphs. Task manager, CPU Time usage and Image

Check the affinity.                                                 Both processors are being used.
Task manager, Check the affinity. Task manager, Both processors are being used.

Set one processor for scheduling this process.
Task manager, Set one processor for scheduling this process

The problem:

When you set the process affinity the problem is that when you restart the computer all the processes will revert back to the normal inefficient Operating System scheduling.

The fix:

You could intervene and set the affinity of each process manually every time you start your computer. Or you can get a program that you can direct each program or service to be scheduled on a certain processor when the Operating System loads it.

These programs are very useful for moving the work load off of all the processor to one specific processor every time the Operating System loads it.

Once you have determined which processor will get the services and programs that use the least cpu scheduling you can put the hog programs on the other cpu(s).

I currently run all my services and low cpu scheduled processes on my '0' cpu, my email, word processor, html editor, IE, and any other program I use frequently on the '1' cpu.

I do not have any lag time when the Anti-virus program runs. I can also run my Defrag program in the back ground with out a performance hit on any of my daily use programs. If I let the Operating System do the processor scheduling (affinity) then the system would drag from time to time while the Anti-virus or defrag program had the cpu time.

Here are a couple of Affinity programs I have found, unfortunately you will have to search for them because the links are now gone from the pages where I downloaded them. As with any thing you download from the internet SCAN it.

Processor Affinity program setaffinity.exe  As you can see in this screen shot how much more complex the program is.
display setaffinity.exe

taskassign.exe No services are displayed, thus you can not set their affinity.
display taskassign.exe

Setaffinity is the more complex program to use. Once you set the affinity of the program or service you have to save it (one at a time). It does how ever have the flexibility to create a file that will load on startup and set the program affinity. This program requires an advance user to setup and run, once you have your programs set then you are done.

TaskAssign does not see your services, it is good choice for the novice computer user.CORE 2 DUO C2D E6750 LGA775 2.66G

One more way to increase the efficiency and optimization of your computer.

An article for the more geeky side of  Processor Affinity.

A newer version with more options (Free) is:
SetAffinity II v1.035 (2008)

Sorry the download for this fine software is gone, you can however find it by searching for Setaffinity II (be sure to scan any file you download for viruses!).

DIY Computer
Repair Insider
Member
Login




You can -

Emergency Repair
D
isk (ERD) - Do
you have one?

Emergency
Repair Disk


Make your own


You keyboard isn't thirsty, and it doesn't need calcium. Milk and other liquids will ruin a keyaboard!

Fix It!
Your DIY Computer
Repair Newsletter!


Click here to
get your copy of
Fix It Today!


This Web
Site is a
labor of Love
!
But Love
doesn't pay
the bills!

Please donate
$5 to keep
it live...

Hardware Question
or problem you
can't find a
solution for?
Ask it here -
Q & A


    Page copy protected against web site content infringement by Copyscape


You can:


Return to
previous page:



diy-computer-
repair.com
Webutation