Can I give the servers in a Backend Group their own Weight and connection limit?
Short answer
Yes. Weight and Connection Limit are per-server fields in a Backend Group: a separate value is entered in each server row of the Backends table in the group form. The default value of Weight is 1; Connection Limit has no default value, and while it is empty no per-server limit is applied. For Weight to be reflected in the distribution, an algorithm that uses weight is selected on the vService; the default Round Robin ignores weight, while Weighted Round Robin uses it.
Problem: The Servers in the Group Do Not Have the Same Capacity
The capacity of the servers in a Backend Group can differ: one has more cores, one is an old server, or one can handle only a limited number of concurrent connections. Even though the group's settings such as health check and SSL are shared, traffic needs to be shared according to the capacity of the servers, and the weak server must not be overloaded.
Solution
Per-server weight and connection limit are given in a single place, the Backends table of the group.
Weight and Connection Limit in the Backends Table
- How it works Each row is written to the configuration as a separate server and gets its own Weight and Connection Limit value.
- Where it is openedLoad Balancer → Backend Groups → Add / Edit → Backends
- Requirement For Weight, an algorithm that uses weight on the vService (e.g. Weighted Round Robin)
- vService type HTTP, L7 TCP and Network
Step-by-Step Configuration
On the Load Balancer → Backend Groups screen, the group is selected and Edit is clicked; for a new group, Add is used.
Each server is a row in the Backends table; a new row is opened with the add control next to the Backends label and comes with port 80.
In each row, Weight (an integer between 1 and 256; its default value is 1) and Connection Limit (an integer between 1 and 65535; it has no default value) are entered. For example, if 3 is given to the powerful server and 1 to the weak server, traffic is shared at roughly 3 to 1.
The Add (Edit when editing) button at the bottom of the form is clicked. The vServices that use the group are reloaded with the new values; open connections are not cut.
The vService that uses the group is selected on the Load Balancer → Load Balancer vService List screen and opened with Edit; it is checked that an algorithm that uses weight is selected in the LB Algorithm field. If the default Round Robin is selected, Weighted Round Robin is selected (on a Network vService, Weighted Round-Robin or Weighted Least-Connection in the LB Algorithm field).
If the algorithm was changed, Save is clicked. While clustering is on and Manual Sync Mode is off (default), the group and vService changes are transferred to the peer device automatically.
Verification
In the Backend Groups list, the Show Backend Services switch is turned on; the Weight value of each server appears in a separate row.
The entered Weight in each rowOn the vService's Live Stats screen, the session counts received by the servers are compared.
Sessions are shared in proportion to the weightsCommon Mistakes
- Leaving the algorithm at Round Robin. The default Round Robin ignores weight; the entered Weight values do not change the distribution.
- Writing 0 in Weight. Weight is in the 1–256 range; for an out-of-range value, the form gives the warning "Weight must be in range 1-256". To take a single server in the group out of traffic, the row must be removed from the group; Maintenance Mode is applied to the whole group.
- Assuming the backup takes over when the Connection Limit is reached. No new connection is sent to a server whose limit is reached; if all servers are full, new requests wait in the queue on HTTP and L7 TCP vServices (there is no queue on a Network vService), and the backup does not take over.
- Entering the same IP:Port in two rows. The group form does not give a warning in this case; the rows must be checked before saving.
How it is done in the documentation
