Web Garden
A Web garden is a Web application whose execution is distributed across more than one processor on a multiprocessor computer. Web gardening is the default behavior for ASP.NET. For example, suppose that you install an ASP.NET application on a computer with eight CPUs. In this case, ASP.NET will automatically launch eight worker processes to handle incoming Web requests, and assign one of these processes to each CPU (a procedure known as setting the affinity of the process).
Web gardens offer the benefit of faster response times on a multiple CPU computer. In particular, if one worker process becomes hung or slowed down because of programming errors or unexpected input, the Web garden can continue serving requests using the other worker processes.
Because ASP.NET enables this behavior automatically, you don't have to do anything to gain the benefit of a Web garden. However, you might want to configure your Web server to not use every processor for Web gardening. To do this, you can set the value of two attributes within the <processModel> element of the web.config file:
♦ webGarden. When set to true, this attribute directs Windows to schedule processes to CPUs (thus enabling the default behavior of Web gardening). When set to false, this attribute uses the cpuMask attribute to determine which processors should participate in a Web garden.
♦ cpuMask. This attribute is a bitmask indicating which processors should participate in a Web garden. For example, setting cpuMask to 7 (which is binary 111) would indicate that processors 0, 1, and 2 (and no others) should participate in a Web garden.
916 Part II TESTING, DEBUGGING, AND DEPLOYING A WEB APPLICATION
w Configuration Files See Chapter 15, q "Configuring a Web Application," for Z more details on using configuration files with ASPNET.
Changes to the <processModel> element only take effect when IIS is restarted and are only effective in the top-level machine.config file. For these reasons, Web gardening is best customized by the system administrator rather than as part of a setup package.
Average user rating: 5 stars out of 1 votes
Post a comment