IIS6.0 Application pool performance optimization and setup tips share 1th/2 page _win server

Source: Internet
Author: User
Tags time limit metabase

IIS6.0 Application pool recycling and worker processes

A company's web site program after a long run, slow speed, restart the site after the speed significantly faster, estimated that the Web site program occupied by the memory and CPU resources can not be released in time, only need to restart the site every time the release of resources. But manual restart is not the solution to the problem, how to achieve automatic management? The IIS6.0 application pool Automatic recycle feature solves this problem.

An application pool is a configuration that links one or more applications to one or more worker process collections. Because applications in an application pool are separated from other applications by the worker process boundaries, applications in one application pool are not affected by problems with applications in other application pools.

Configuring an application pool for a Web program requires the following steps: 1 Create an application pool, right-click application pool, new/application pool, named Kefuapppool;2, specify the application pool for the Web program, the application pool in the Web site virtual directory properties application settings (N) The setting for automatic collection of application pools in the select Kefuapppool;3. There are several ways to recycle:

A. Depending on the running time

The system defaults to 1740 minutes, that is, 29 hours, this is not very good control, recommended not.

B. Number of requests

This depends on the specific situation. If there are only 10 requests, but there are 5 of those who are requesting a page that compares resources (perhaps the annual report of statistics, and so on), this time will appear when the process is off, if the request has 1000 but one also did not run a comparison of resources of the page, this time the process is certainly very normal, Therefore, depending on the number of requests, it does not necessarily meet the actual needs.

C. Planned time

This is actually very good, but exactly what time to recycle it? Usually we are set in the early morning two three o'clock, this time the recovery is necessary, but for the occurrence of the possibility of a high memory footprint is not very applicable.

D. Memory (virtual memory or used memory)

This is due to the memory problem caused by the process when it is too appropriate, but set the value of how much better is a very important problem, the value can not be too small, otherwise, if the traffic is large over this value will automatically recycle, this is not necessary. Be sure to look at the actual occupancy of the process before making a decision.

The following highlights the understanding of the worker process recycling application pool.

By default, the WWW service establishes "overlapping recycle", which continues to run the worker process to terminate until a new worker process is started. In an overlapping recycle scenario, the process to be recycled continues to process the request, while the WWW service creates an alternate worker process. Start a new worker process before you stop the old worker process, and then direct the request to the new process. This design prevents service disruption because the old process still communicates with HTTP.sys to process requests before shutting down. Because the shutdown timeout value that can overlap off or start can be configured, the process can be terminated while the worker process is still processing the request (if it does not finish processing the request within the time limit).

Note: When the WWW service reclaims a worker process, it does not disconnect existing TCP/IP connections. The HTTP protocol stack (http.sys) establishes and maintains a TCP/IP connection.

Each application pool in IIS is managed by a "worker process", which is the "W3wp.exe" process. If you have programs running in multiple application pools, we can see multiple w3wp.exe. This can be seen in Task Manager, as shown in the following illustration, with two w3wp.exe processes in Task Manager that correspond exactly to two application pools where applications are running.

Run iisapp-a at a command prompt to see which application pool w3wp.exe is associated with.

The following figure shows the recycle of the application pool Kefuapppool manually, before recycling, the application pool and the worker process after recycling. We note that a work process (pid=3896) has been added to the recycling process (pid=3896), the old work process (pid=5716) is stopped, and the new worker process (pid=3896) formally replaces the old process, This prevents the service from being interrupted during application pool recycling, ensuring that the program runs continuously. The worker process PID for the other two application pools doesn't change. The diagram shows a good picture of the process of application pool recycling.

Application Pools This thing really makes Management Server people headaches, if not set up a good site at any time can strike, or even drag the server. Therefore specially find this article for everybody reference.

In addition, if the site traffic is not very large, no one at night to visit, you can try to restart the server in the morning, so you can improve the speed of the server, for the next day to prepare for the visit.

The core of IIS 6 is worker process isolation mode, and the application pool defines how the worker process works, so that the application pool is the core of the entire IIS 6.

Unlike IIS 5, which uses only a single application pool, IIS 6 working in worker process isolation mode can create multiple application pools, which are completely isolated from each other, and no application pool will be affected by the time the service is stopped.

Before using the application pool, you should determine the number of application pools you need. There may be a lot of friends who think that since the different application pools are completely isolated, I just need to create an application pool for each Web site. This approach is available when there are fewer Web sites on the IIS server, but if there are many Web sites on the IIS server, this approach does not apply because different application pools create their own worker processes when they are accessed. When a large number of worker processes work concurrently, it consumes a lot of system resources and CPU utilization, but reduces server performance. You should divide the Web sites that are on the IIS server against the importance, isolation, security, and stability of the Web site, and then determine the number of application pools that are required depending on the situation. For those very important web sites, Web sites that need to be isolated separately, Web sites running code stability and insecure security are configured to use separate application pools, and other normal Web sites are configured to use a common application pool.

By default, when IIS is installed, a default Web site is created and an application pool named DefaultAppPool is used, and the application pool under the default configuration is already working well, and it is recommended that you configure the application pool only when you specifically need it.

Configure Application Pool Properties

To expand the application pool folder in the IIS management Console, and then right-click the corresponding application pool, click Properties, and you can configure the following in the properties of the application pool:

Recovery

In the Recycle tab, you can set up how the work process is recycled:

Recycle worker process (minutes): Recycle worker process after how many minutes the worker process is running, enabled by default, and set to 1740 minutes (29 hours);

Recycle worker process (number of requests): Terminates the worker process after the worker process has processed the number of HTTP requests, which is disabled by default, and the default value of 35000 if enabled;

Recycle worker processes in the following time: Recycle worker processes at specified times, disable by default, and if enabled, click Add button to add recycle time, use 24-hour system to define the time of recovery;

Recycle worker process when too much memory is consumed:

Maximum virtual memory (Mega): Reclaims worker processes when the virtual memory used by the worker process reaches the set value, which is disabled by default, and is recommended to be set to no more than 70% of the total virtual memory;

Maximum memory (trillion): Reclaims worker processes when the physical memory used by the worker process reaches the set value, which is disabled by default, and if enabled, the default value is M; The recommended setting is 60% of the total physical memory;

It is also important to note that the application pool has the following two kinds of worker process recycling methods, but neither of these methods will cause disruption to the Web service:

By default, the application pool uses overlapping recycling methods. In this way, when the application pool closes a worker process, a worker process is created before the old worker process is closed until the new worker process is successfully created;

The application pool can also close the old worker process before creating a new worker process.

If the Web application does not support multiple instance runs, you must configure the application pool to prohibit overlapping recycling methods. This configuration cannot be modified in the IIS management Console and can only be done by modifying the DisallowOverlappingRotation metabase property of the corresponding application pool in MetaBase.xml.

Current 1/2 page 12 Next read the full text

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.