System problems occur when IIS application pool-web garden-maximum Worker Process> 1

Source: Internet
Author: User

Problem summary:

1. When the enterprise database cache is used as the cache, some of the cache objects cannot be hit. The static variable counter does not output data as expected.

2. If the session fails to be obtained, the session is configured as sessionstate mode = "inproc" in Web. config"

 

Cause:

When the maximum worker process is greater than 1 (worker ntasks), iiswill open nw3wp.exe(?aspnet_wp.exe) for webapplications to provide services. These processes are independent, including static variables and caches. They fully enable a new application server;

When IIS accepts browser requests, IIS will automatically allocate requests to different service processes. At this time, if the two requests are not allocated to the same service process, the last time, such as the value assigned to the static variable and the written cache, were not found in this request.

 

Solution:

Method 1: Enable the Asp.net state service with sessionstate mode = "StateServer" to allow multiple service processes to share sessions. The configuration is as follows: <sessionstate mode = "StateServer" stateconnectionstring = "TCPIP = xxx. xxx. xxx. XXX: XXXX "timeout =" 20 "/>

Method 2: Use sessionstate mode = "sqlserver" to save the session to the database and configure it to <sessionstate mode = "sqlserver" sqlconnectionstring = "omitted... "cookieless =" false "timeout =" 20 "/>. You must initialize the database.

Method 3: Use memcached to store sessions and cache objects.

 

Summary:

Currently, the cache of spring. NET and Enterprise Library in the project must be upgraded.

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.