|
|
In pursuit of reducing time to market of web projects, the issue of load planning is often postponed for later. In the future, when the load on the server will constantly increase, this can lead to extremely undesirable consequences, because when the server "falls", not only the nerves of technical specialists will suffer, but also profits.
At a certain stage, the lack of computing power can be solved by increasing resources or optimizing the application code. However, one day you may face the fact that none of these means will be able to ensure the smooth operation of the web resource or their further use will be inappropriate from a cost point of view.
And then clustering comes to the rescue - when several computing servers are combined into a cluster, and requests are evenly distributed between the servers using balancing methods and algorithms.
The basic principle of clustering is to "give" a set of incoming client requests to different servers . Let's figure wordpress web design agency out at what levels balancing can be carried out ( load balancing ), how load balancers themselves work and what methods are used today.
Balancing levels
The process occurs at three levels of the OSI model:
Network ( L3 );
Transport ( L4 );
Applied ( L7 ).
Let's see how balancing methods differ depending on the selected level.
Network layer (L3)
The essence of L3 load balancing is to bind several physical servers to a single IP address. There are several ways to solve this problem.
DNS balancing is the allocation of several IP addresses at once for one domain name.
Creating an NLB cluster is the combination of several servers into a single cluster of input and computing nodes with subsequent load balancing in accordance with a special algorithm.
IP Balancing Using an Additional Router.
By territorial principle - with this balancing method, several "clones" of the service with identical addresses are placed at once, but each one is in a separate region of the Internet. By the way, many content delivery networks operate on the basis of this method. It is most actively used in services with a huge number of users from different countries and even continents.
Network level balancing is a reliable but expensive way to balance the load on a server.

Transport layer
Balancing at the transport level is an effective and simple way to distribute the load. The principle is quite simple: the client's request does not go directly to the server, but goes to the server load balancer , which determines which machine will process it and forwards it further. A variety of methods can be used to select a server: determining the most free one, sorting by turn, taking into account the number of active connections, and others.
Server Load Balancer Scheme
Application layer
Load balancing at the application level also works through proxying requests. However, unlike transport balancing, here requests are distributed based on the requested content or actions. For example, a web page will be created via server A, and read via server B. In some cases, balancing is performed depending on what type of content the user requested. Conventionally speaking, video materials will be “delivered” by one server, images by another, and text by a third.
Balancing methods
The choice of a specific balancing method and algorithm depends on the characteristics of the web project and the goals you plan to achieve.
In particular, when choosing, it is worth paying attention to how effectively the balancing algorithm reduces the response time and query execution time. It is also necessary to take into account that a suitable balancing algorithm should process queries in accordance with the principles of fairness and efficiency - not allowing long queues and server downtime.
|
|