Urgent.News

What's breaking now, across thousands of outlets.

Tech

Your Load Balancer Is a Single Point of Failure. Fix It With VRRP

You built the system the way everyone tells you to. Three API servers instead of one, so a crash doesn't take you down. A load balancer in front of them spreading traffic around. Your domain points at the load balancer, the load balancer health-checks the backends, and when one server dies the other two pick up the slack. Textbook. Then at 2 AM the load balancer itself dies. Not a backend. The…

Many developers build systems with multiple API servers behind a load balancer to ensure reliability. However, they often overlook the load balancer itself as a single point of failure. In the event of a load balancer crash, all requests to the application will time out, leading to downtime. The solution is to use a virtual IP address (VIP) and Virtual Router Redundancy Protocol (VRRP) to prevent the load balancer from becoming a bottleneck.

A VIP is an address that remains constant even if the hardware behind it fails or is replaced. Clients connect to the VIP, and the load balancer distributes traffic among the backend servers. This allows for seamless scaling and maintenance of the backend servers without affecting the clients.

VRRP is a protocol that enables multiple machines to share a virtual IP address and automatically switch to a backup machine when the primary one fails. By configuring multiple nodes with the same virtual IP and a shared group ID, the highest-priority node becomes the master and owns the VIP. The other nodes act as backups, remaining silent until they take over ownership of the VIP if the master fails. This failover process typically occurs within 1-3 seconds, providing rapid recovery from failures.

The virtual MAC address associated with the VIP ensures a smooth transition during failover, as switches do not need to relearn the address mapping. Additionally, gratuitous ARP broadcasts from the new master instantaneously update the network's ARP cache, eliminating the need for the traditional waiting period for stale mappings to expire during the failover process.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Trying Out AgentInspect

Imagine a travel agent answering: Tokyo is rainy today. Choose indoor sightseeing. Did it check the weather first? Or did it return that sentence without calling the weather tool?

More from Friday 11 September →