What is load balancing?
Load balancing distributes incoming work or network requests across multiple service instances. It aims to use resources efficiently, reduce overload on individual servers and support service continuity.
How distribution decisions work
Methods include round-robin, least-connections and weighted distribution. Health checks assess whether a server is suitable for receiving new requests. An open port alone does not prove that an entire application is healthy; critical dependencies may also matter. Some applications require a session to stay on one server, but this can restrict distribution. Keeping session state in shared storage offers another approach. Network-layer and application-layer balancers can inspect different information. Routing may also consider proximity or load across locations.
Resilience and design limits
Using two servers does not automatically provide uninterrupted service. Both may depend on the same database, power source or faulty release and fail together. The load balancer itself also needs redundancy. Avoiding an unhealthy server is useful, but blindly retrying an unfinished payment might duplicate the operation. Application design must address repeatability and transaction identifiers. Monitoring should consider latency, error rates, connection counts and server saturation. Scaling decisions should not depend solely on CPU usage; database and external-service limits also need evaluation.