How do I temporarily stop all traffic to a server; can I set Weight to 0?
Short answer
Weight cannot be set to 0; Weight is in the 1–256 range and Connection Limit in the 1–65535 range, and even at the lowest values the server continues to receive traffic. On HTTP and L7 TCP vServices, the recommended way to temporarily take a server out of traffic is Maintenance Mode: the server stops receiving new traffic without being deleted, and open connections are not cut. Depending on the situation, removing the Backend Service from the Default Backend Services list of the vService (also works on a Network vService), removing the group row, making it a Backup Service, making the health check fail on the server side or enabling maintenance mode from WEB-CLI are also used.
Problem: Taking a Server Out of Traffic Without Deleting It
When patching, updating or hardware work is to be done on a server, traffic must be moved away from it without affecting users. The first idea is to set Weight to 0; however, in TR7 Weight is at least 1. Deleting the server, on the other hand, loses its settings and vService connections, and it must be set up again when the work is finished.
Solution: Six Methods
The methods are alternatives to each other; only one is applied at a time.
| Your situation | Suitable method |
|---|---|
| I want to put a single Backend Service or an entire Backend Group into maintenance | Method 1: Maintenance Mode |
| I want to remove the server from only one vService, or the vService is of the Network type | Method 2: Removing it from the vService list |
| I want to remove a single server in the group | Method 3: Removing the group row |
| The server should receive traffic only in an emergency | Method 4: Making it a Backup Service |
| I want to remove it from the server side without touching TR7 | Method 5: Making the health check fail |
| I want to put one or many Backend Services into maintenance from the command line or with a script | Method 6: Maintenance Mode with WEB-CLI |
Method 1: Maintenance Mode Recommended
- How it works The Backend Service receives no new traffic on any of the HTTP and L7 TCP vServices in which it is used; open connections continue until they end. The settings and vService connections stay in place. In a Backend Group, the mode is applied to all the servers of the group together.
- Where it is openedLoad Balancer → Backend Services (or Backend Groups) → Edit → Maintenance Mode
- Requirement Another Backend Service or a backup in the list to take over the traffic; otherwise clients receive 503
- vService type HTTP and L7 TCP (on a Network vService, Method 2 is used)
Step-by-Step Configuration
In the Used in tab of the preview panel that opens when the Backend Service is clicked, it is checked which vServices will be affected.
On the Load Balancer → Backend Services screen, the Backend Service is selected and Edit is clicked (right-click → Edit can also be used). For the entire group, the group is opened on the Load Balancer → Backend Groups screen.
The Maintenance Mode switch is turned on (its default value is off).
The Edit button at the bottom of the form is clicked. The vServices that use the Backend Service are reloaded; ongoing connections are not cut, and new connections go to the other Backend Services. While Clustering is on and Manual Sync Mode is off (default), the setting is transferred to the peer device automatically. When the work is finished, the switch is turned off and saved in the same way; if the health check result is OK, the server receives traffic again.
Verification
In the list, an amber ambulance icon appears next to the name of the Backend Service, and the amber Maintenance status appears on the Live Stats screen of the vService; the current session count drops to zero as the open connections end.
Maintenance · no new sessionsMethod 2: Removing It from the vService List
- How it works The Backend Service is removed only from the list of that vService; it continues to receive traffic on other vServices. The Backend Service definition is kept.
- Where it is openedLoad Balancer → Load Balancer vService List → vService → Edit → Default Backend Services (and the Conditional Backend Services sets, if any)
- Requirement At least one other Backend Service remaining in the list; otherwise clients receive 503
- vService type HTTP, L7 TCP and Network
Step-by-Step Configuration
In the Used in tab of the preview panel of the Backend Service, it is checked in which vServices it is used.
On the Load Balancer → Load Balancer vService List screen, the vService is selected and Edit is clicked.
The Backend Service is removed from the Default Backend Services list and, if any, from the lists of the conditional sets.
Save is clicked. When the maintenance is finished, the Backend Service is added back to the same lists and the vService is again saved with Save.
Verification
That vService no longer appears in the Used in tab in the preview of the Backend Service.
vService not in the Used in listMethod 3: Removing the Group Row
- How it works The server is removed from the Backends table of the Backend Group; the other servers of the group continue to receive traffic.
- Where it is openedLoad Balancer → Backend Groups → Edit → Backends
- Requirement At least one other row remaining in the group; when a single row remains, the delete control does not appear
- 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.
The address, Cookie Content, Connection Limit and Weight values in the row are noted down; when the row is removed, this information is lost.
In the Backends table, the row is removed with its delete control.
The Edit button at the bottom of the form is clicked. When the maintenance is finished, the row is added again with the same values and the group is saved again.
Verification
In the Backend Groups list, the Show Backend Services switch is turned on.
Server not among the group rowsMethod 4: Making It a Backup Service
- How it works The Backend Service turns into a backup; it does not receive traffic unless all the main Backend Services in the list are unavailable. Since it receives traffic if the main servers go down, it is not a definite "no traffic at all" solution.
- Where it is openedLoad Balancer → Backend Services → Edit → Backup Service
- Requirement Other healthy Backend Services in the list
- vService type HTTP and L7 TCP
Step-by-Step Configuration
On the Load Balancer → Backend Services screen, the Backend Service is selected and Edit is clicked.
The Backup Service switch is turned on (its default value is off).
The Edit button at the bottom of the form is clicked. If the server is to return to normal distribution, the switch is turned off and saved.
Verification
In the list, an amber backup server icon appears in the name column; in Live Stats, no new sessions come to the server.
Backup icon · no new sessionsMethod 5: Making the Health Check Fail
- How it works On the server side, the endpoint polled by the health check (e.g.
/health) is set to return an error; TR7 considers the server Error and takes it out of traffic. No change is required in TR7. - Where it is opened On the Backend Service (server) side
- Requirement A Health Checks profile assigned to the Backend Service
- vService type HTTP and L7 TCP; on a Network vService, only while Port Range is off and Protocol is not ANY - L3
Step-by-Step Configuration
It is checked that a profile is selected in the Health Check field of the Backend Service; if it is No Check, this method does not work. If a profile is selected, step 4 is next.
On the Load Balancer → Backend Services screen, the Backend Service is selected and Edit is clicked; a profile is created with the add button in the Health Check list and is selected automatically (how to add). The profile must be of a type that detects the health endpoint returning an error (e.g. HTTP). Details: How should I set the Period, Timeout, Required Successes and Required Failures values?
The Edit button at the bottom of the form is clicked.
The port or page checked on the server is closed so that it returns an error (e.g. the maintenance flag of the application). When the check fails Required Failures times in a row as set in the profile, the server is taken out of traffic.
When the work is finished, the health endpoint is reopened; when the check succeeds Required Successes times in a row, the server returns to traffic.
Verification
The Health indicator in the Backend Services list is checked.
Health: ErrorMethod 6: Maintenance Mode with WEB-CLI
- How it works The maintenance mode in Method 1 is enabled from the command line; with
update-many, it can be applied to many Backend Services at once. - Where it is opened TR7 WEB-CLI →
lb backend updateandlb backend update-many - Requirement WEB-CLI access and the ID of the Backend Service
- vService type HTTP and L7 TCP
Step-by-Step Configuration
The IDs of the Backend Services are listed:
lb backend listThe ID seen in step 1 is written in place of <id>:
lb backend update id <id> --maintenanceMode trueThe bulk update command is written; since no ID is given, a selection list with checkboxes opens, the records are checked, and the warning that states the number of affected records is confirmed by typing the confirmation word:
lb backend update-many target selected --maintenanceMode trueWhen the work is finished, the same command is run with --maintenanceMode false. In a cluster, the change is transferred to the peer device according to the rule in Method 1.
Verification
The maintenance field in the lb backend show <id> output is checked; the ambulance icon appears in the panel.
Maintenance field trueCommon Mistakes
- Setting Weight to 1 and assuming the traffic will stop. Weight 1 is the lowest share; it is not zero.
- Setting Connection Limit to 1. The server still receives connections; when the limit is reached, requests wait in the queue.
- Deleting the Backend Service for temporary work. Deletion is permanent; the Backend Service is removed from all the vServices in which it is used and must be set up again together with its settings.
- Turning on the maintenance mode of the group for a single server in the group. All the servers of the group are taken out of traffic; Method 3 is used.
- Trying to verify maintenance mode by looking at the Health column. The Health column does not show the maintenance status; the ambulance icon and Live Stats are checked.
- Relying on Maintenance Mode on a Network vService. Maintenance mode is not applied to the distribution of a Network vService; Method 2 or 3 is used.
How it is done in the documentation
