Difference between revisions of "IPVS"
(→Job Scheduling Algorithms) |
|||
(21 intermediate revisions by 4 users not shown) | |||
Line 1: | Line 1: | ||
− | IPVS (IP Virtual Server) implements transport-layer load balancing inside the Linux kernel, so called Layer-4 switching. IPVS running on a host acts as a load balancer before a cluster of real servers, it can direct requests for TCP/UDP based services to the real servers, and makes services of the real servers to appear as a virtual service on a single IP address. | + | IPVS (IP Virtual Server) implements transport-layer [[load balancing]] inside the Linux kernel, so called [[Layer-4 switching]]. IPVS running on a host acts as a [[load balancer]] before a cluster of real servers, it can direct requests for TCP/UDP based services to the real servers, and makes services of the real servers to appear as a virtual service on a single IP address. |
− | + | ||
== IP Load Balancing Technologies == | == IP Load Balancing Technologies == | ||
− | * [[LVS/NAT | Virtual Server via Network Address | + | Since the IP load balancing techniques have good scalability, IPVS extends the TCP/IP stack of the Linux kernel to support three IP load balancing techniques: [[LVS/NAT]], [[LVS/TUN]] and [[LVS/DR]]. The box running IPVS acts as a [[load balancer]] of network connections |
+ | from clients who know a single IP address for a service, and distributes them to a set of | ||
+ | servers that actually perform the work. | ||
+ | |||
+ | * [[LVS/NAT | Virtual Server via Network Address Translation]] | ||
* [[LVS/TUN | Virtual Server via IP Tunneling]] | * [[LVS/TUN | Virtual Server via IP Tunneling]] | ||
* [[LVS/DR | Virtual Server via Direct Routing]] | * [[LVS/DR | Virtual Server via Direct Routing]] | ||
+ | * [[LVS/FNAT | Virtual Server via Full NAT]] | ||
== Job Scheduling Algorithms == | == Job Scheduling Algorithms == | ||
+ | |||
+ | === Connection Scheduling Algorithms inside the Kernel === | ||
+ | |||
+ | IPVS schedules jobs at connection granularity inside the Linux kernel. Here connection is defined as data communication between client socket and server socket, no matter whether it uses TCP or UDP protocol. For scheduling UDP datagrams, IPVS [[load balancer]] records UDP datagram scheduling with configurable timeout, and the default UDP timeout is 300 seconds. Before UDP connection timeouts, all UDP datagrams from the same socket (protocol, ip address and port) will be directed to the same server. | ||
+ | |||
+ | IPVS has implemented ten connection scheduling algorithms inside the kernel so far: | ||
* [[Round-Robin Scheduling]] | * [[Round-Robin Scheduling]] | ||
* [[Weighted Round-Robin Scheduling]] | * [[Weighted Round-Robin Scheduling]] | ||
− | * [[Least-Connection | + | * [[Least-Connection Scheduling]] |
* [[Weighted Least-Connection Scheduling]] | * [[Weighted Least-Connection Scheduling]] | ||
* [[Locality-Based Least-Connection Scheduling]] | * [[Locality-Based Least-Connection Scheduling]] | ||
Line 20: | Line 30: | ||
* [[Shortest Expected Delay Scheduling]] | * [[Shortest Expected Delay Scheduling]] | ||
* [[Never Queue Scheduling]] | * [[Never Queue Scheduling]] | ||
+ | |||
+ | === Dynamic Feedback Load Balancing Scheduling === | ||
+ | |||
+ | The dynamic feedback load balancing scheduling algorithm is to use connection scheduling algorithm and adjust server weight based on dynamic feeback load information of each server, in order to avoid load imbalance among servers. | ||
+ | |||
+ | * [[Dynamic Feedback Load Balancing Scheduling]] | ||
+ | |||
+ | == Software == | ||
+ | |||
+ | See http://www.linuxvirtualserver.org/software/ipvs.html for downloading IPVS related software. | ||
+ | |||
+ | [[ipvsadm]] is used to set up, maintain or inspect the IP virtual server table in the Linux kernel. For how to compile ipvsadm on different Linux distributions, check [[compiling ipvsadm on different Linux distributions|this article]] for detailed information. | ||
== Design and Implementation == | == Design and Implementation == | ||
+ | * [[IPv6 load balancing]] - the status of IPv6 support in IPVS and examples | ||
+ | * [[IPVS FULLNAT and SYNPROXY]] - a new packet forwarding method, and defense against synflooding attack | ||
+ | * [[IPVS Design]] | ||
+ | * [[IPVS Implementation]] | ||
== Ongoing Development == | == Ongoing Development == | ||
− | |||
=== IPVS On FreeBSD === | === IPVS On FreeBSD === | ||
The [http://dragon.linux-vs.org/~dragonfly/htm/lvs_freebsd.htm LVS On FreeBSD] project was started by Li Wang, the goal is to port IPVS code to FreeBSD. Now, the LVS On FreeBSD module supports the [[LVS/DR]] and [[LVS/TUN]] ip load balancing technologies. | The [http://dragon.linux-vs.org/~dragonfly/htm/lvs_freebsd.htm LVS On FreeBSD] project was started by Li Wang, the goal is to port IPVS code to FreeBSD. Now, the LVS On FreeBSD module supports the [[LVS/DR]] and [[LVS/TUN]] ip load balancing technologies. | ||
+ | |||
+ | === Todo === | ||
+ | |||
+ | * [[IPVS Wish List]] | ||
+ | |||
+ | [[Category:LVS Software]] | ||
+ | [[Category:Load Balancing]] | ||
+ | [[Category:Terms and Abbreviations]] |
Latest revision as of 09:21, 8 August 2012
IPVS (IP Virtual Server) implements transport-layer load balancing inside the Linux kernel, so called Layer-4 switching. IPVS running on a host acts as a load balancer before a cluster of real servers, it can direct requests for TCP/UDP based services to the real servers, and makes services of the real servers to appear as a virtual service on a single IP address.
Contents
IP Load Balancing Technologies
Since the IP load balancing techniques have good scalability, IPVS extends the TCP/IP stack of the Linux kernel to support three IP load balancing techniques: LVS/NAT, LVS/TUN and LVS/DR. The box running IPVS acts as a load balancer of network connections from clients who know a single IP address for a service, and distributes them to a set of servers that actually perform the work.
- Virtual Server via Network Address Translation
- Virtual Server via IP Tunneling
- Virtual Server via Direct Routing
- Virtual Server via Full NAT
Job Scheduling Algorithms
Connection Scheduling Algorithms inside the Kernel
IPVS schedules jobs at connection granularity inside the Linux kernel. Here connection is defined as data communication between client socket and server socket, no matter whether it uses TCP or UDP protocol. For scheduling UDP datagrams, IPVS load balancer records UDP datagram scheduling with configurable timeout, and the default UDP timeout is 300 seconds. Before UDP connection timeouts, all UDP datagrams from the same socket (protocol, ip address and port) will be directed to the same server.
IPVS has implemented ten connection scheduling algorithms inside the kernel so far:
- Round-Robin Scheduling
- Weighted Round-Robin Scheduling
- Least-Connection Scheduling
- Weighted Least-Connection Scheduling
- Locality-Based Least-Connection Scheduling
- Locality-Based Least-Connection with Replication Scheduling
- Destination Hashing Scheduling
- Source Hashing Scheduling
- Shortest Expected Delay Scheduling
- Never Queue Scheduling
Dynamic Feedback Load Balancing Scheduling
The dynamic feedback load balancing scheduling algorithm is to use connection scheduling algorithm and adjust server weight based on dynamic feeback load information of each server, in order to avoid load imbalance among servers.
Software
See http://www.linuxvirtualserver.org/software/ipvs.html for downloading IPVS related software.
ipvsadm is used to set up, maintain or inspect the IP virtual server table in the Linux kernel. For how to compile ipvsadm on different Linux distributions, check this article for detailed information.
Design and Implementation
- IPv6 load balancing - the status of IPv6 support in IPVS and examples
- IPVS FULLNAT and SYNPROXY - a new packet forwarding method, and defense against synflooding attack
- IPVS Design
- IPVS Implementation
Ongoing Development
IPVS On FreeBSD
The LVS On FreeBSD project was started by Li Wang, the goal is to port IPVS code to FreeBSD. Now, the LVS On FreeBSD module supports the LVS/DR and LVS/TUN ip load balancing technologies.