A process of solving the problem of load balancing

Source: Internet
Author: User
Tags pack stack trace truncated microsoft website
Process | solve | problems
Environment Description:
Development platform is dotnet b/S. NET Framework 1.1
The official web server and test machine are win2003
The original main web site, in six Web servers to do load balancing. Run more stable.
A new sub station is now being developed to load balance on another three Web servers. This load balancing setting is similar to the settings for the main web site.

Solution steps:
1 sub-station test through the test machine, running normally. Prepare for a formal environment (three Web servers)

2 Copy the sub-station program to the three Web servers, configure the child station related configuration, open site and load balance start testing.

3 The page appears normal when testing, but an exception occurs when the server-side event is triggered.
Error message "Viewstate is invalid to this page" (Invalid view state) does not provide sufficient information to resolve this issue
Why is the same program in the test machine run no problem, put in the formal environment, there is an exception?
In the Microsoft website to find this exception to explain (HTTP://SUPPORT.MICROSOFT.COM/DEFAULT.ASPX?SCID=KB;ZH-CN;831150), said that the proposed installation of the Microsoft. NET Framework 1.1 Service Pack 1.
Then, suspecting that the patch was not installed, the registry key was viewed:
Item Name: HKEY_LOCAL_MACHINE Oftware\microsoft\net Framework setup\ndp\v1.1.4322
An SP value of 0 indicates that the Framework 1.1 Service Pack is not installed.
Then go to the Microsoft website to download the. NET Framework 1.1 Service Pack 1 and the. NET Framework 1.1 Service Pack 1 asp.net security update-Windows Server 2003

4 Install these two patches, run the sub-station program, when the server-side event is triggered, still appear an exception. The exception is as follows:
Exception Details: System.Web.HttpException: Cannot validate data.
Stack trace:
[HttpException (0x80004005): Cannot validate data. ]
[HttpException (0x80004005): Authentication of ViewState failed. 1) If This is a cluster, edit <machineKey> configuration so all servers use the same validationkey and validation al  Gorithm.  AutoGenerate cannot is used in a cluster.  2) Viewstate can only be posted the same page. 3) The ViewState for this page might is corrupted.]
Back to the 831150 article read: "After applying this hotfix, the view state error message title becomes unable to Validate data." Although the new error message format does not specifically describe the problem, it provides more information than the previous error message format. ”
Know it should be ViewState value has been truncated?!
The question translates: What causes the "ViewState value to be truncated"?
Because the program works well in a test environment, it may be a system-level problem.
Compare the formal and test environments: the formal environment is load-balanced by three servers, while the test environment is only one server.

5 Modify the load balancing settings to open only one web Server. After the test, we found that the exception was not present. Three machines tested separately, no abnormalities.
Speculation: There may be a problem with load-balancing settings. So the system administrator, he said, the child station load balancing settings and the same as the main station AH. But ask him to reconfirm the difference between the two load balancing settings.
Once again, the persistence Type (process continuation) of the load balancing pool is found to be none, that is, the service end is not kept connected. This causes the "ViewState value to be truncated" each time a server-side event is triggered. The value of the persistence Type (process continuation) is then changed to Simple,timeout set to 600 seconds.

Summarize:
Programmers should not only write programs but also understand the system properly. This problem is not always encountered, as a solution to the problem of ideas for everyone to share.

Attach: Load balance generally set up three places to ensure the continuation of the process. Start load balancing first, and then set "Enable Connection rebind" to true. The last persistence type is generally set to simple plus the timeout time.
Note: I have very little research on load balance, I do not know whether other similar software is also set up, the principle should be similar.


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.