Programming Microsoft ASP.NET 4 - Dino Esposito [50]
In this instance, moz and ie are device filters, meaning that the property they attribute should be used only if the user agent matches the filter. So where’s the problem? The problem arises with some AJAX functionality and microformats that extended the schema to allow additions. An example is when some JavaScript libraries add their own expando attributes prefixed with a string, as shown here: Without countermeasures, the sys prefix would be mistaken for a device filter and the whole attribute would be stripped off in absence of a matching filter. In fact, sys is not likely to be the nickname of any browser. In ASP.NET 4, by adding the previous script to the configuration file you instruct ASP.NET to ignore some of the names that appear to be device filters. The timeout="hrs:mins:secs|Infinite" idleTimeout="hrs:mins:secs|Infinite" shutdownTimeout="hrs:mins:secs|Infinite" requestLimit="num|Infinite" requestQueueLimit="num|Infinite" restartQueueLimit="num|Infinite" memoryLimit="percent" webGarden="true|false" cpuMask="num" userName="username" password="password" logLevel="All|None|Errors" clientConnectedCheck="hrs:mins:secs|Infinite" comAuthenticationLevel="Default|None|Connect|Call| Pkt|PktIntegrity|PktPrivacy" comImpersonationLevel="Default|Anonymous|Identify| Impersonate|Delegate" responseDeadlockInterval="hrs:mins:secs|Infinite" responseRestartDeadlockInterval="hrs:mins:secs|Infinite" autoConfig="true|false" maxWorkerThreads="num" maxIoThreads="num" minWorkerThreads="num" minIoThreads="num" serverErrorMessageFile="" pingFrequency="Infinite" pingTimeout="Infinite" maxAppDomains="2000" /> As mentioned, the machine.config file remains the root of the configuration hierarchy also in IIS 7 and newer versions. The second level in the hierarchy is given by the root web.config file located in the same folder as machine.config. Under IIS 7, or newer, an additional level in the hierarchy is represented by the applicationHost.config file located in the system32\inetsrv\config folder. To edit the content of this file, and thus configure most of the settings of the process model, you can use the visual editors in the IIS Manager tool. Figure 3-3 shows how to configure some parameters of the process model for a given application pool in the server. Figure 3-3. Configure the process model for a given application pools in IIS 7.5. By default, the machine.config file contains the following: ... This means that ASP.NET automatically configures some critical attributes to achieve optimal performance. You might want to tweak some of these attributes to tailor a configuration for your specific application. Table 3-12 describes these attributes. Table 3-12. Optimizing the ASP.NET Process Model Attribute Description maxIoThreads Indicates the maximum number of IO threads per CPU in the thread pool. The default is 20 (indicating a total of 20x N threads on a machine with N CPUs). maxWorkerThreads Indicates the maximum number of worker threads per CPU in the thread pool. The default is 20 (meaning a total of 20xN
This section configures the ASP.NET process model—that is, the procedure that brings a request to be processed in the HTTP pipeline. The attributes of the