About load Balancing in ASP.

Source: Internet
Author: User

ASP. NET site for load balancing:based on the HTTP protocol we may find that we have two points to solve:the first is load balancing, we need a load balancer. it can be done by DNS polling, which is configured on the DNS server to obtain a different IP address each time the DNS query for the same host name that we load-balances. The advantage of this is that the configuration is simple, the disadvantage is that the browser access to each server is equal, not based on the load level of the server to automatically route requests to the less-loaded servers. you can automatically forward HTTP requests to a lighter server by monitoring the load on the backend servers through a dedicated load balancer device. In addition, you must monitor the IIS load on the background server, not the CPU load of the entire server. It may also be necessary to establish a heartbeat connection between the load balancer and the background service app to avoid a server IIS process or the application running in it has been down, instead, the load balancer monitors the server for the least load and forwards a large number of requests to the opposite effect. the second session state is maintained and migrated. because of the stateless nature of the HTTP protocol, we usually save some state data of the client in the session, after load balancing, the server that arrives at the two HTTP requests may not be the same, which can cause this situation. The session set in the previous request processing becomes unusable in the second request, causing an application error. So we're going to move the session. The implementation of the method is the session of the unified storage and inter-server sharing. There are five ways to save the session in ASP., off, InProc is stored in the memory of the server process and is clearly not meeting the requirements. Two other ways to meet:StateServer is to save the session in a dedicated state server. This allows each server to access the same stateserver for sharing purposes. SQL Server saves the session in the database. can also achieve the goal. Custom Self-customization of the storage scheme, our own writing can certainly be achieved. comparison, custom this kind of own implementation is more troublesome generally not, SQL Server can use the cluster of the database to achieve high performance and high availability, stateserver of course, can also be achieved by means of high availability, However, there seems to be no cluster implementation, so performance is limited. In addition, if you want to do load balancing when you configure the session in StateServer and SQL Server, you must override the MachineKey node in Web. config:<machinekeyvalidationkey= "1234567890123456789012345678901234567890AAAAAAAAAA"decryptionkey= "123456789012345678901234567890123456789012345678"validation= "SHA1"decryption= "Auto"/>Otherwise, each application server will get a different session.

About load Balancing in ASP.

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.