This step-by-step article describes how you can restrict ASP.NET to use specific processors in a multiprocessor system. You can configure ASP.NET applications to use specified processors in a multiprocessor system. This is useful to control the overall performance effect that Web applications may have on a server. When you restrict multiple ASP.NET applications to certain processors on a single server, you limit the opportunity for an application to affect the performance of another application. This is particularly useful when the ASP.NET application executes on the same physical server as the SQL Server, and the SQL Server configuration specifies different processors.
Note In most cases, you can reach optimal performance if you allow all processes to use all processors. Processor usage for ASP.NET must be restricted only to limit the effect on other processes.
To force an ASP.NET application to use specific processors, you must convert a binary number to determine the correct settings. Then you can edit the Web.config file for the application. In the Web.config file, you add or you modify the processModel element. To do this, follow these steps:
To open Calculator, on the task bar click Start and then click Run.
In the Open text box, type calc.exe and then click OK.
On the View menu, click Scientific.
On the View menu, click Binary.
Use 0 and 1 to specify the processors ASP.NET can or cannot use.
Use 1 for the processor that you want to use for ASP.NET. Use 0 for the processor that you do not want to use for ASP.NET. For example, when you want to use the first two processors for ASP.NET of a four-processor computer, type 1100.
On the View menu, click Decimal.
Note the decimal number.
Open the Web.config file in a text editor such as Notepad. The Web.config file is located in the folder where the application is saved.
In the Web.config file, add the processModel configuration element under the System.web element.
Note: Before adding <processModel> to Web.config file, the user has to make sure that the allowDefinition attribute in the <processModel> section of the Web.config file is set to Everywhere.
Add and then set the webGarden attribute of the processModel element to True.
Add and then set the cpuMask attribute of the processModel element to the result that is determined in your calculation.
Do not preface the number with 0x because the result of the calculation is a decimal number. The following example demonstrates the processModel element that is configured to enable only the first two processors of a four-processor computer.