Topics
IP/URL hash is a static load balancing algorithm which applies hash function to client IP address or request URL. The result of hash determines which server handles the request.
IP hashing works best when client distribution is relatively uniform and session persistence is critical.
Pros
- Ensures requests from same client IP consistently go to same server. Useful for stateful applications that need session persistence
- Predictable and consistent routing
- Simple to implement
Cons
- Can lead to uneven server load if IP distribution is skewed
- Adding or removing servers can disrupt the hash mapping, causing some clients to be routed to different servers
- Changes in client IP (mobile networks, NAT) can disrupt session persistence
- Does not account for server load or capacity