Home > OS >  The comparison of LVX and Nginx load balancing function
The comparison of LVX and Nginx load balancing function

Time:10-25

1. The concept of load balancing:
Load balancing based on the existing network structure, which provides a cheap and effective transparent way to expand the bandwidth of the server and network equipment, increase throughput, strengthen the network data processing ability, improve the network flexibility and availability,
Load balancing (Load Balance its meaning is Shared by multiple operations performed on the unit, such as a Web server, FTP server, enterprise key application servers and other mission critical servers, etc., to complete the tasks together, big data 2. Big data high concurrency environment using the importance of Load balancing strategy:
近年来,在网络时代的技术背景下,互联网技术在企业和用户需求的合力推动下迅速蔓延,流媒体作为代替普通文字和图片的网络媒介,在互联网中得到了爆发式的推广和应用,在现有的网络环境下,面对巨大的视频数据传输量和用户的高并发性,传统的单播技术和IP组播技术均难以支撑局面,进而,以应用层组播技术为基础的网络电视和视频直播系统得到了快速的应用和发展, 应用层组播技术避免了单播传输的低效率,有效解决了IP组播难以部署的问题,使得组播通信的主要任务由网络层路由器转移到了应用层的端主机,端主机作为应用层组播网络的主角,在提供灵活性的同时具有不确定性,其自身的软硬件性能,网络环境和用户特性直接影响着组播系统的整体性能,综合评估组播网络中各端主机节点的性能,使得组播网络的整体负载得到有效均衡是本文的研究重点, 本文基于国内外的研究成果,对应用层组播模型和负载均衡技术进行了深入的分析,设计了一种网-树混合双层应用层组播模型,并基于此模型提出了一种动态度约束负载均衡策略(DDLBS),该模型中,组播网采用逻辑上的分层策略,上层组播节点采用性能稳定的网状模型,下层组播节点为了避免回传浪费资源的现象采用基于树结构的簇模型,在组播网的构建中对端主机的软硬件性能,上下行带宽,数据传输性能和用户特性等因素进行综合分析,并采用评估算法评估端主机节点的综合性能,根据端主机性能的差异对组播网络中的端主机节点施行动态的度约束机制,DDLBS在综合组播网中各节点性能的情况下,对节点的度进行动态调整,有效地均衡了各节点的负载,使组播网整体的负载得到了大大地降低,同时提高了组播系统的稳定性,很好的适应了组播网络大数据量传输和高并发性的需求,
3. Load balancing is a way of implementation (hardware, software) :
By far the most common Web load balancing application of load balance, according to the principle of implementation is different, common Web load balancing technology include: DNS polling, IP load balancing and CDN, including IP load balancing can be done using hardware or software methods,

IP load balancing can use hardware devices, also can use software to realize, hardware products are mainly F5 - BIG - IP - GTM research (F5), software products mainly include the LVS, HAProxy, NginX, among them the LVS, HAProxy works in 4 to 7 layers, NginX work in layer 7,
4. LVX Nginx and origin of the concept of the author:
LVX:
The LVS: use the Linux kernel clustering a high performance, high availability of the load balancing server, it has a good Scalability, Scalability, Reliability (Reliability) and Manageability, Manageability,
Nginx:
Nginx by igor, sawyer is Russia's visits to the second Rambler. Ru site (Russian: Р а м б л е р), the first public version 0.1.0 from released on October 4, 2004,
Nginx (engine "x") is a high-performance HTTP and the reverse proxy server, is also a IMCP/POP3/SMTP server,
5. LVX Nginx and the difference of load balancing method and the advantages and disadvantages:
One, the advantage of the LVS:
1, strong ability to resist load, because the LVS works of logic is very simple, and work in the network layer 4 only do request distribution, no traffic, and so on the efficiency of basic don't need too much consideration, the LVS in my hands, just had a problem: the highest in concurrent equalizer within a short period of time appear lost package phenomenon, according to the analysis for the network problems, namely, the bearing capacity of the network adapter or linux2.4 kernel has to the limit, memory and CPU aspects basic consumption,
2, the configuration is low, this is usually a big disadvantage, but it is also a big advantage, because there is no too much configurable option, so in addition to increase or decrease in the server, don't need to touch it frequently, greatly reducing the chance of human error,
3, stable work, because of its ability to resist load is very strong, so high stability is also naturally, have all sorts of the LVS and complete hot standby scheme of two, so what's the problem, a little don't have to worry about the equalizer itself will node failure, the LVS will automatically, so the overall system is very stable,
4, no flow, has been mentioned above, the LVS only distribute the requests, the traffic is not out of itself, so that it can be used to do some line shunt, no traffic at the same time also to preserve the equalizer IO performance is not affected by the heavy traffic,
5, basically can support all application, because the LVS work in four layers, so it can do load balancing for almost all applications, including HTTP, database, chat rooms, etc.,
Another: the LVS is not completely tell node failure, such as under the allocation way of WLC, cluster has a node without VIP, can make the whole cluster cannot use, then use the WRR allocation will lose a machine, the present problems in further tests, so use the LVS also have to be careful to burn a lot,
Second, nginx and compared the results of the LVS
1, nginx work in the network layer 7, so it can be done for HTTP application itself distribution strategy, such as for the domain name, directory structure, etc., by contrast the LVS does not have such function, so the nginx alone this available is far more than the LVS occasions; But nginx useful these features make it adjustable degrees higher than the LVS, so often want to touch to touch, by article 2 advantages of LVS, touch is much, also will be more human problems risk,
2, nginx dependence on network is small, as long as ping make sense in theory, web access is normal, can even make sense nginx, nginx can also distinguish between inner and outer net at the same time, if is having both inside and outside network node, is equivalent to single machine has the backup line; The LVS is dependent on the network environment, the moment the server within the same network segment and use direct way to bypass the LVS, effect is can be guaranteed, and note that the LVS need to apply to the host at least one more IP to do the Visual IP, seem to be can't use own IP for VIP, must complete the LVS administrator, do follow up learning a lot of knowledge about network communication, is no longer as simple a HTTP,
3, nginx installation and configuration is simpler, test rise very convenient also, because it can print a log errors, the LVS installation and configuration, the test will take a long time, because the same as above mentioned, the LVS dependence on the network is bigger, a lot of times can configure succeed because of network problems instead of configuration problems, the problems to solve and corresponding will be much trouble,
4, nginx also can withstand the high load and stable, but the degree of load and poor stability several levels: the LVS nginx process all traffic so limited by machine IO and configuration; Itself of bugs are inevitable; Nginx no ready-made hot standby scheme of two, so run on stand-alone or riskier, all things it is hard to say, on the single
5, nginx can detect the inside of the server failure, such as processing according to the server page returned a status code, timeouts, etc., and will return an error of the request to submit to another node, the current in the LVS ldirectd can also support for the server to monitor the condition of the internal, but the principle of the LVS can't retransmission request, retransmission request that, for example, users are uploading a file, and process the upload node just in the process of upload fails, nginx will pass on to another server to deal with, and direct the LVS is cut off, if it is uploading a large file or an important file, the user may be annoyed because of this,
6, nginx asynchronous processing of requests can help lighten the load node server, if using apache foreign service directly, so appear a lot of narrowband link apache server will take up a lot of memory and cannot be released and used much nginx do apache agent, these narrowband link is blocked by nginx, apache on won't pile up too many requests, so a considerable amount of memory footprint is reduced, which use squids also has the same effect, even if the squids itself is configured to not cache, are of great help to the apache or, LVS without these functions, also cannot compare,
7, nginx can support HTTP and email (email function estimates that fewer people use), the LVS supported application on this more than the nginx,
In use, the general to the front end should be the LVS, namely the DNS point should be the LVS equalizer, the advantages of the LVS make it very suitable for this task,
Important IP address, best left to the LVS hosting, such as a database of IP, the webservice server's IP, and so on, these IP address over time, the use of surface will be more and more big, if change the IP failure will follow, so these important IP to the LVS escrow is the most reliable, the only drawback is the need to VIP number is more,
Nginx can be used as the LVS node machine, one is to use nginx function, 2 it is to use nginx performance, squid, of course, this level also can be used directly, squids function is weaker than nginx many, performance is also somewhat inferior in nginx,
Nginx can also be used as a middle agent, this level nginx basically no opponent, the only way to shake the only lighttpd nginx, though lighttpd nginx no can do full functions, configuration is not so clear and easy to read, in addition, the middle proxy IP is also important, so it also has a VIP and middle the LVS is the perfect solution,
Nginx as a web server static, but outside the confines of discussed in this article, a simple way,
Specific applications have specific analysis, if is relatively small site (day PV<10 million), is completely can use nginx, if machine, also can use the DNS polling, the LVS the amount of machine, or more; Large sites or important service, the machine don't worry, want to consider using the LVS,
  • Related