Load balancing in Web applications (end part)
Part I: DNS round rotation
Vivek Viswanathan
Hardware-based load balancing
Hardware load balancers solve many of the problems that we have just faced in the above DNS round robin software method through virtual IP addresses. The load balancer will display a virtual IP address for the external network, which maps to the addresses of each machine in a cluster. Therefore, this conveyor belt needs to provide an IP address of all the computers in the cluster to the outside world.
When a request arrives at the load balancer, it will record the request header to point to the other machines in the cluster. If a machine is removed from the cluster, the request will not run at risk of 'hit' on this dead server, since all other servers in the cluster will appear to have the same IP address. This address remains the same even if a node in the cluster fails. When a response is returned, the client will see the response coming from the hardware load balancer. In other words, the client will deal with a computer that is a hardware equalizer.
Advantages
• Relationship between servers . The hardware load balancer reads cookies or URLs are being read on each request by the client. Based on this information, it can record the header information and send the request to the appropriate node in the cluster, where its session is maintained.
These load balancers can provide server-to-server relationships in HTTP communications, but not through secure channels like HTTPS. In secure channels, messages are SSL encrypted and can avoid load balancing from reading session information.
• High availability via automatic failover system . Failover occurs when a node in the cluster cannot process a request and redirect it to another node. There are two types of failover:
- Failover level required . When a node in the cluster cannot process a request (usually because of a failure), it will move this request to another node.
- Transparent session redundancy . When a call fails, it will be routed smoothly to another node in the cluster to complete execution.
This type of equalizer provides request level failover; ie when it detects that a node has a problem, this equalizer will redirect all subsequent requests sent to this node to another active node in the cluster. However, any session information on the dead node will be lost when requests are redirected to a new node.
Transparent session failover requires some knowledge of execution for a process in a node, because the hardware load balancer can only detect network level problems, no errors. To execute transparently on failover, nodes in the cluster must combine with other nodes and have shared memory or shared databases to store all session data. Also, if a node in the cluster has a problem, a session can continue in another node.
• Metrics . Since all requests to a web application must go through the load balancing system, the system can determine the number of active sessions, the number of active sessions connected in different cases, the time periods. Response time, maximum voltage time, the number of sessions throughout the maximum voltage range, the number of sessions throughout the minimum voltage range . All this test information is used to refine the entire system. System to optimize performance.
Defect
The downside to hardware routing is its cost, the complexity of the setup issue, and the possibility of a problem in the future. Because all requests are routed through a hardware load balancer, the hardware requirement error affects the entire site.
Balancing HTTPS requests
As mentioned above, it is very difficult to load balance and maintain session information of requests using HTTPS protocol, since they are encrypted. The hardware load balancer cannot forward requests based on information in the header, cookie or URL. There are two ways to solve this problem:
- Proxy of Web Server
- Hardware SSL decoder
Additional Web Server proxies
A Web server proxy is in front of a cluster of Web servers taking all requests and encrypting them. It then redirects them to an appropriate node, based on header information in the header, cookie and URL.
The advantage of Web server proxies is that they provide a way to get server-to-server communications for SSL-encrypted messages, without any extra hardware. But the extended SSL process requires an extended load on the proxy.
Apache and Tomcat . In many server systems, Apache and Tomcat servers work together to manage all HTTP requests for dynamic pages (JSSP or servlets). Tomcat servers also manage static pages, but in coordinated systems, they are usually set up to manage dynamic requests.
You can also configure Apache and Tomcat to control HTTPS requests and in load balances. To do this, run the multi-Tomcat server instance on one or more machines. If all Tomcat servers are running on one machine, they should be configured to listen on different ports. To execute load balancing, you create a special Tomcat template called Tomcat Worker.
As you can see on the image above, the Apache Web server receives HTTP and HTTPS requests from clients. If the request is HTTPS, then the Apache Web server encrypts the request and sends it to the Web server adapter, the server sends the request to Tomcat Worker, including the load balancing algorithm. Similar to the Web server proxy, this algorithm also balances the load between machines like Tomcat.
Hardware SSL decoder
Finally, we should mention here that there are some hardware devices that can decode SSL requests. Detailed instructions about them are not covered in this article, but can be briefly stated, they are placed in front of the hardware load balancer and allow decoding information in cookies, headers and URLs.
These hardware SSL decoders often operate faster than Web server proxies and are highly scalable. However, as most hardware solutions, they still cause many complex problems in the setup and configuration.
You should read it
May be interested
- Balance downloading Web-Proxy Client with ISA Server 2004 Standard Editionload balancing of web-proxies is often understood as one of the functions provided by isa server enterprise edition. but for many, the extra cost of the enterprise edition makes them hesitant, although the desire of organizations or companies is always in need.
- How to fix Safari error can not load websites on Macever encountered the problem of not being able to load pages on safari on a mac? obviously your network connection is extremely stable, but a website can't keep loading on safari. here is how to fix this phenomenon.
- How to Ride a 'Hoverboard' (Two‐Wheeled Self‐Balancing Scooter)so you have a two-wheeled self-balancing scooter - now you want to learn how to ride it. its super easy to learn and even easier than learning to ride a full size segway! get started with step 1 and you'll be smooth sailing in no time....
- Operator overload and Load overlap in C ++c ++ allows you to define more than one definition for a function name or an operator in the scope, respectively called load overloading (function overloading) and load operator overloading in c ++. .
- Install Cherokee with PHP5 and MySQL supported in Fedora 14currently, cherokee is one of the lightest web server, high flexibility and easy to configure and set up. in addition, it also supports many advanced technology platforms such as fastcgi, scgi, php, cgi, encryption connecting tls and ssl protocols, virtual hosts, encryption mechanisms, load balancing of resources, data data of the system, apache log file ...
- Guide to speed up website loading in a simple wayaccording to kissmetrics, 47% of users expect a website to load in about 2 seconds, 40% of users will abandon a website if it takes more than 3 seconds to load.
- 5 useful applications for small business ownersare you an online business or a small business owner operating your business day and night? you will encounter difficulties in communicating, balancing life, accounting or some of the daily management issues that you do not have enough time to solve. the following 5 applications will be useful for you to solve that problem.
- How to fix Steam 'Failed to load steamui.dll' error on Windows 10how to fix failed to load steamui.dll error when opening steam on windows 10 operating system? share 6 ways to fix the failed to load steamui.dll error most effectively
- How to load Rules Of Survival card with phone scratch cardcurrently rules of survival can load game cards with phone scratch cards easily with support on vng system.
- How to load cards in the Rules Of Survival PC gameon the rules of survival: the survival law has released a new card-loading channel, making it easy for users to load cards via the in-game system.