acassen/keepalived logo

acassen/keepalived

Free

Keepalived

FreeFree tier
Type
Open Source
Company
acassen

About acassen/keepalived

Keepalived is a routing software written in C that provides simple and robust load balancing and high availability to Linux systems and Linux-based infrastructures. It runs in production across data centers, ISPs, and hardware vendors worldwide. Keepalived builds load balancing on top of the Linux Virtual Server (IPVS) kernel module for Layer 4 load balancing, and runs health checkers that watch each server pool to manage real server membership in real time. High availability is achieved through the VRRP protocol (v2 and v3 for IPv4 and IPv6), with sync groups to maintain routing path consistency and IPSEC-AH security for protocol advertisements. It also implements BFD for sub-second link and peer failure detection, enabling fast VRRP failover. The daemon uses a central I/O multiplexer driving a multi-threaded framework, with separate child processes for VRRP, health checking, and BFD stacks, and a minimalistic parent process for monitoring.

Key Features

Full implementation of VRRP v2 and v3 for IPv4 and IPv6 with sync groups and IPSEC-AH security
Layer 4 load balancing driven by the kernel IPVS module with multiple scheduling algorithms and forwarding methods
Layer 4 to Layer 7 health checkers that automatically add and remove real servers based on real-time health
BFD (Bidirectional Forwarding Detection) for millisecond link and peer failure detection to drive fast VRRP failover
Central I/O multiplexer with a multi-threaded framework; separate child processes for VRRP, health checking, and BFD stacks
Parent process monitors children for robustness; daemon splits into minimalistic parent and dedicated child processes
Supports IPv4 and IPv6 for all protocols
Quick installation via standard Linux package managers (apt, dnf)

Pros & Cons

Pros
  • Robust, production-proven software used across data centers, ISPs, and hardware vendors
  • Open-source with active community and long history on GitHub (4.6k stars, 774 forks)
  • Written in C for performance and low resource usage
  • Combines load balancing, high availability, and health checking in a single daemon
  • Supports both IPv4 and IPv6, and multiple VRRP versions
  • BFD integration enables sub-second failover for critical infrastructure
  • Available as a package in most major Linux distributions
Cons
  • Configuration can be complex for advanced setups (requires understanding of VRRP, IPVS, and Keepalived syntax)
  • Limited to Layer 4 load balancing (though health checkers can reach Layer 7)
  • Not a fully AI-driven or automated solution; requires manual configuration and tuning

Best For

Production load balancing for data centers and ISPs using LVS/IPVSHigh availability failover of floating IPs between nodes using VRRPReal-time health monitoring and automatic server pool adjustmentFast network failure detection and failover with BFD

FAQ

What is Keepalived?
Keepalived is a routing software written in C that provides load balancing and high availability to Linux systems. It uses the IPVS kernel module for Layer 4 load balancing, VRRP for high availability, and includes health checkers and BFD for fast failover.
How do I install Keepalived?
Most Linux distributions ship Keepalived as a mainline package. On Debian/Ubuntu run 'sudo apt install keepalived'; on RHEL/Fedora/Rocky run 'sudo dnf install keepalived'.
What routing protocols does Keepalived support?
Keepalived implements VRRP v2 and v3 for IPv4 and IPv6, and BFD for fast link failure detection. It also integrates with LVS/IPVS for Layer 4 load balancing.