Maximum number of work processes for IIS 6.0 web garden

  • 2020-05-15 02:51:21
  • OfStack

IIS 6.0 allows application pools to be configured as one Web garden (Web Garden). To understand the concept of Web garden, you can imagine a scenario: suppose you have a IIS 5.0 server and three Web website, each 1 Web site running the same application, if IIS 5.0 automatically according to the circular loop pattern will request sent to these functional equivalence in turn, actually separation Web website, separate the load to the three different processes, can constitute a small Web farm (Web Farm) - this is Web garden.

In the Web garden of IIS 6.0, we don't have to create an additional Web site, just specify the number of worker processes for an application pool. The specific configuration steps are: open the "properties" dialog box of the application pool, go to the "performance" page, and enter the number of processes in the "maximum number of worker processes" input box under the "Web garden", as shown in figure 8. When the load on the server is small and no additional worker processes are required, IIS 6.0 will automatically reduce the actual number of worker processes after 1 fixed time (20 minutes by default, configurable). If additional worker processes are required as the load increases, IIS 6.0 again increases the number of worker processes. This one - cut operation is done automatically, without administrator intervention.

Web park: in Web park, you can configure the maximum number of worker processes to be used by this application pool. The default is 1, and the maximum can be set to 4000000. Configuring multiple worker processes can improve the performance of the application pool for handling requests, but before setting up multiple worker processes, consider the following two points:

Each worker process consumes system resources and CPU occupancy; Too many work processes can lead to a dramatic depletion of system resources and CPU utilization;

Each worker process has its own state data, and if an Web application relies on the worker process to hold state data, it may not support the use of multiple worker processes.


Question: IIS 6.0 has a new feature called Web garden that allows you to configure application pools to use multiple worker processes. When does IIS create an additional worker process? What should we know before we implement Web garden?

Answer: when you create an application pool, IIS 6 is notified to create a worker process to transmit the contents of the Web site, files, and folders assigned to the application pool. You can improve extensibility by configuring the application pool to start multiple worker processes instead of one. This feature is called the Web garden, which is a small "Web farm". Instead of using multiple computers to deliver the same content (Web farm), you can use multiple processes on one computer to deliver the same content.

When configuring the IIS 6 application to Web garden, you simply set the number of worker processes greater than 1 in the maximum number of worker processes box on the performance TAB of the application pool properties. If this value is greater than 1, each request starts a new instance of the worker process, and the maximum number of processes that can be started is the maximum number of worker processes that you specify. Subsequent requests are sent in a loop to the worker process.

Web garden is useful when your application has limited resources. For example, if your connection to the database is slow, you can increase the number of connections to the database by using multiple worker processes to increase user throughput.

Although using the Web garden is useful in some cases, it is important to note that the session information for each worker process is one-only. Because requests are looped to the application pool worker process, the Web garden may be of little use to applications where session information is stored in the process. In rare cases, having multiple worker processes running the same application can cause resource contention. For example, if all worker processes try to log information to a log file, or use resources that are not dedicated to multiple concurrent accesses, resource contention issues may arise.

If you don't have these problems, then the Web garden might be just what you need, and it could be very useful.

After testing, if too much web garden is set up, the background will not be able to log in

asp is temporarily unable to share session, but this problem can be solved by cookies, asp.net and you can refer to the following Settings.

After setting the maximum working process of iis site web garden, session fails. When the number of processes is greater than 1,session fails the solution
SESSION is saved in the process, so when WEB is larger than 1, there are two processes, and SESSION cannot be saved in each other, so it fails!
Set SESION to save on the server and you're done!

SESION set to save on server: ASP.NET configuration Settings -- > State management -- > Change the session state setting to StateServer.

IIS6.0 WEB garden configuration

To create an Web garden for the application pool, note the following:

1. Each working process will consume system resources and the occupancy rate of CPU; Too many work processes can lead to a dramatic depletion of system resources and CPU utilization;
2. Each worker process has its own state data, and if an Web application relies on the worker process to save state data, then multiple worker processes may not be supported.
Resource contention. Having multiple worker processes running the same application creates resource contention
Creating an Web garden for application pools enhances performance in the following ways:

1. Reliable request processing: when one of the worker processes in the application pool stops processing (for example, when the script engine stops responding), other worker processes can accept and process requests from that application pool.
2. Reduced resource contention: when the Web garden reaches a stable state, each new TCP/IP connection will be allocated to one work process in the Web garden according to the circular scheme.

This can have the effect of balancing the workload and reducing resource contention tied to the worker process.
Configure the Web garden using the IIS manager

1. In IIS manager, expand the local computer and the application pool in turn, right-click the application pool, and then click properties.
2. Click the performance TAB, and then in the maximum number of worker processes box under Web park, type the number of worker processes you want to specify to the application pool. To form an Web garden, you must type a value greater than 1 for the application pool.
3. Click ok.
4. Alternatively, you can configure the Web garden by setting the configuration database property MaxProcesses. The MaxProcesses attribute determines the maximum number of worker processes an application pool can allow to service its requests. The value 0 represents an unmanaged application pool that is not serviced by a worker process.
5. The default value of the MaxProcesses property is 1, which is the default number of worker processes serving the application pool. To configure the application pool to be an Web garden, set the MaxProcesses property to a value greater than 1.

Web garden is configured using Adsutil.vbs

1. In the run dialog box, type cmd, and then click ok.
2. At the command prompt, type:


    cscript %SystemDrive%\Inetpub\AdminScripts\adsutil.vbs set W3SVC/AppPools/ ApplicationPoolName /MaxProcesses n

Replace n with the number of worker processes to service the application pool.


Related articles: