Setting Processor Affinity Permanently
Posted By Chris Stinson in General, Internet Information Server, PHP, Windows on May 18, 2007
The post below talks about processor affinity and setting IIS to use only one processor to increase stability of certain applications (PHP ISAPI anyone?).
You can set the affinity by opening Task Manager and selecting w3svc.exe or inetinfo.exe on the Processes tab. Right click and choose Set Affinity. Uncheck the processors which should not execute the application.
This is a temporary solution since it is reset once you restart Windows or IIS. Some people often disregard setting processor affinity as a fix since it never seems to work…but this is because they don’t set it permanently. Below is how to set the processor affinity permanently.
Grab the Imagecfg.exe tool from the \support\debug\i386 folder of a Windows NT 4.0, or the Imagecfg.exe tool from the Windows 2000/2003 Server Resource Kit.
Open a CMD prompt and type:
where 0xn is the affinity mask and drive:\Path\program.exe is the program you wish to set. The mask indicates which processor is to run the desired application. On a dual-core system, you use CPUs 0 and 1 (not 1 and 2).
CPU MASK
0 0x1
1 0x2
2 0x4
3 0x8
Related posts:
- WordPress 2.1.x – 2.2 Breaks PHP 4.4.4
- Migrating websites from IIS6 to IIS7
- SPF Records for Windows Email Servers
- POP3 Protocol Missing in Windows 2008 / IIS7
- Wordpress & PHP on Windows Server IIS 6


