For configuration in HAProxy to automatically distribute the requests to multiple server instances we can use the Round Robin Algorithm.
Load balancer handles traffic depending on the load balancing algorithm we configured at backend and by default it uses Round Robin Algorithm.
Load balancer performs the following functions:
Distributes client requests or network load efficiently across multiple servers.
Ensures high availability and reliability by sending requests only to servers that are online
Provides the flexibility to add or subtract servers as demand dictates
Different load balancing algorithms provide different benefits; the choice of load balancing method depends on your needs:
Round Robin – Requests are distributed across the group of servers sequentially.
The load balancing algorithm of a backend is set to round robin when no other algorithm, mode nor option have been set. The algorithm may only be set once for each backend.Please find this doc to install HAProxy using round robin.