In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the knowledge of "what are the characteristics of LVS, Nginx and HAProxy load balancers". Many people will encounter this dilemma in the operation of actual cases, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Lvs features:
1. Strong anti-load ability, using ip load balancing technology, only do distribution, so lvs itself does not generate much traffic
two。 Good stability, reliability and perfect hot backup scheme; (e. G. lvs+keepalived)
3. It has a wide range of applications and can be load balanced for all applications.
4. Regular processing is not supported and static and dynamic separation cannot be done.
There are four commonly used algorithms:
1.rr: round-robin, which is assigned to the backend server in turn
2.wrr: weight round call, which is allocated according to the load of the back-end server
3.lc: minimum connection, assigned to the server with the least established connections
4.wlc: the connection with minimum weight, which is allocated according to the processing capacity of the backend server.
Ipvsadm-p (persistence) can be used to maintain session. The default is 300 seconds.
Nginx features:
1. Working on layer 7, you can deal with regular rules; (for example, diverting domain names and directories)
two。 Simple configuration, ping can carry out the load function, can detect the status of the back-end server through the port, does not support url detection
3. Anti-high concurrency, using epoll network model to deal with customer requests
4. Only http and email are supported, and the application range is relatively small
5.nginx is mainly http and reverse proxy server with low system resource consumption.
There are four commonly used algorithms:
1.rr: (default) polling, which is assigned to the back-end server in turn
2.weight: allocation based on back-end server performance
3.ip_hash: each request is allocated according to the hash result of accessing ip, and the concurrency time is appropriate to solve the session problem.
4.fair: (extension strategy), the nginx kernel is not compiled by default. The load is judged according to the response time of the back-end server, and the lightest one is selected for processing.
Haproxy features:
1. Supports two proxy modes: tcp (layer 4) and http (layer 7), and supports virtual hosts
1. Easy to configure and support url to detect the status of backend servers.
2. Used only as load balancing software. In the case of high concurrency, the processing speed is higher than that of nginx.
The 3.tcp layer is mostly used for mysql slave (read) server load balancing.
Four commonly used algorithms:
1.roundrobin: polling, which is assigned to the back-end server in turn
2.static-rr: allocation based on back-end server performance
3.leastconn: minimum connectors first
4.source: based on the request source ip, similar to the ip_hash of nginx.
Why do you want to solve session sessions?
In a load balancing environment, each user may have irregular access to the back-end server. In some applications, it is necessary to require that all requests accessed by the same user within a certain period of time be assigned to the same back-end server for processing, such as e-commerce sites, user registration pages, etc., as soon as they refresh the page, they will be assigned to another back-end server, and the information on the page just now is gone. In this case, it is critical to assign the same server to process the request!
That's all for "what are the characteristics of LVS, Nginx, and HAProxy load balancers?" Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.