One site & nb p; & mda h; two servers?
In most cases, the placement of the site is as follows. All information is hosted on the server. In the future, requests from the user’s computer using the DNS system are sent to this server, which responds with all the necessary data. However, in some cases this scheme is very complicated. To do this, a copy of the site is placed on one or more servers, and a special module (load balancer) sends requests from users’ computers to the least loaded one.
What is it for? Let’s try to sort out this issue.
And first, let’s consider the advantages of a “multi-server” solution (load balancing) for the site. There are several of them. The first is a higher speed of the web project. Indeed, two (or more) servers will process HTTP requests coming from visitors’ computers much faster due to their separation between themselves. Of course, there are other ways to increase site performance. For example, you can try to optimize the “engine” and the database. Or there is another option – just try to increase the server capacity, increasing the number of processors, adding RAM or installing faster hard drives. That’s just such an improvement has its limits. You can increase the performance of the site through the use of a “distributed server”. That is, all HTTP requests are received by a special module that sends it to the least busy server. Moreover, in this case, performance improvement can be carried out with almost no restrictions due to an increase in the number of servers.
The more servers – the higher the reliability and speed
The second plus load sharing across multiple servers is reliability. Indeed, any computer (including the server) sometimes fails. In addition, he could fail some equipment. Thus, the site located on this server will simply be unavailable until the administrators eliminate the cause of the failure or replace the faulty components. In principle, for personal pages and small corporate web projects, this is not scary. But for large well-known sites and even more so for any e-commerce systems, the emergence of such a situation can lead to serious consequences. In addition, in the latter case, there is a possibility that a failure will occur during the execution of a transaction, as a result of which not only important information will be lost, but also real money. Thus, the use of a load distribution system allows one of the servers to automatically switch all HTTP requests to the remaining ones if one of the servers fails. At the same time, users may not notice anything at all, with the exception, perhaps, of a slight slowdown in speed.
The third plus of load balancing is the constant access of visitors to the site. The third plus is the placement of the site on several servers — there is no need to suspend access to the web project in the event of preventive maintenance. Moreover, the need for these very works arises quite often. First, you need to periodically change the server hardware. Secondly, and most importantly, administrators constantly have to update the operating system and the software they use. Today, the “holes” in security are found quite often. And each of them has to put a “patch”. If you have one server at your disposal, then to stop it, it is best to use the “quiet hour”, that is, the time with the least activity of visitors (usually it is 5-7 am). That’s just such a solution has two serious drawbacks. Firstly, if the site has sufficient popularity throughout the vast territory of our immense Motherland, then there may not be a clearly defined “quiet hour”. After all, when it is 6 am in Moscow, it is already a day in Vladivostok, and vice versa. And secondly, administrators will be unhappy with the decision to carry out server prophylaxis at night, and they can be perfectly understood.
The server periodically requires maintenance.
If your site is hosted on several servers, then the prevention is not any significant problem. We simply redirect all requests to one server, and in this time we work with another. Well, then the opposite. In this case, visitors to the web project are again unaware of any work. In principle, the same can be done just for a serious website update, for example, when changing a design. This option is especially useful when you need to update the “engine” of the web project. While users are working with the old site on one of the servers, administrators have the opportunity to change the scripts and test their performance on the other.