How should I set the Period, Timeout, Required Successes and Required Failures values?
Short answer
Timeout is selected above the normal response time of the server under load, and Period in balance between fast detection and server load, and both are kept below 120 seconds. Required Failures is kept high enough to tolerate short outages, and Required Successes high enough to prevent the server from returning to traffic before it becomes stable; the tuning guide in the docs recommends Period 1–2 s and Timeout 1–5 s for fast services. The values are changed in the Health Checks profile from the interface or in WEB-CLI with lb hc update; the change affects all the Backend Services that use the profile, and these Backend Services do not receive traffic until they again receive Required successes successful checks.
Problem: The Check Is Either Too Sensitive or Too Slow
The default values (Period 1 s, Timeout 1 s, Required successes 3, Required failures 2) are for web services that respond fast. In slow services, a short Timeout brings down a healthy server; in services under load, low thresholds cause the server to go in and out constantly (flapping). Conversely, very high values cause a failed server to be noticed late.
| Service | Period | Timeout | Required failures | Required successes |
|---|---|---|---|---|
| Fast web and API | 1–2 s | 1–5 s | Low (default 2) | – |
| Slow (database, reporting) | At a reasonable level | Increased according to the expected response time | Increased | – |
| Critical service (together with a content check in HTTP/HTTPS) | Low | – | – | Increased |
| Environment under load | Not too low | According to the normal response time under load | Increased | – |
The docs give no separate recommendation for the values marked "–" in the table; these fields can be left at the default.
Source: Recommended values and tuning guide. In how many seconds a failure will be noticed is calculated with the formula on this page: How many seconds does it take for a server to be considered "down", and how do I calculate it?.
Solution: 3 Methods
Method 1 and Method 3 change the existing profile; Method 2 moves the Backend Services to the new values one by one.
| Your situation | Suitable method |
|---|---|
| The values of all the Backend Services that use the profile should change together | Method 1: Editing the profile |
| I want to move the Backend Services gradually | Method 2: Creating and assigning a new profile |
| I update the profile from WEB-CLI | Method 3: WEB-CLI |
Method 1: Editing the Profile Recommended
- How it works The values in the profile are changed; all the Backend Services that use the profile are checked with the new values. After the change, the status of these Backend Services returns to Preparing and becomes OK again after Required successes consecutive successful checks.
- Where it is openedLoad Balancer → Profiles → Health Checks → profile → Edit
- Requirement Knowing on which Backend Services the profile is used (Used in tab)
- vService type All
Step-by-Step Configuration
On the Load Balancer → Profiles → Health Checks screen, the profile row is clicked; the Backend Services and vServices that will be affected are seen in the Used in tab of the preview.
While the profile is selected, Edit is clicked (Edit).
Period, Timeout, Required Successes and Required Failures are entered. In the form, Required successes and Required failures accept the range 1–10, Period 0.5–3600 and Timeout 0.01–3600 seconds; if Period and Timeout are set to 120 seconds or more, 1 second is applied.
The Edit button at the bottom of the form is clicked. Since the Backend Services that use the profile do not receive traffic until they again receive Required successes successful checks, the change is made at a low-traffic time. In a cluster, the change is transferred to the peer device automatically by default; if Manual Sync Mode is on, it is sent with Synchronize.
Verification
The Period, Timeout, Required successes and Required failures values appear in the setting badges of the Health Check card in the Backend Service preview.
New values · OK (green)Method 2: Creating and Assigning a New Profile
- How it works A separate profile is created with the new values, and the Backend Services are moved to this profile one by one; each move affects only that Backend Service.
- Where it is openedLoad Balancer → Profiles → Health Checks → Add · Load Balancer → Backend Services → Edit → Health Check
- Requirement None
- vService type All
Step-by-Step Configuration
The Configuration Menu is opened with the TR7 logo at the bottom left; the Load Balancer → Profiles → Health Checks path is followed and Add is clicked (How to add?).
Name is entered; Check Type and the type-specific fields are selected the same as in the existing profile, and the new Period, Timeout, Required Successes and Required Failures values are entered.
The Add button is clicked.
The Load Balancer → Backend Services path is followed; the first Backend Service is right-clicked and Edit is selected. For a Backend Group, the same operation is done on the Backend Groups screen (Assignment for a group).
The new profile is selected in the Health Check field.
The Edit button is clicked; after the Backend Service becomes OK, steps 4–6 are repeated for the next Backend Service.
Verification
After each move, the status is checked in the Health column of the Backend Services list (Health status indicator).
OK (green)Method 3: WEB-CLI
- How it works The threshold fields are written with
--testInterval,--timeout,--requiredSuccessand--requiredFailure; for more than one profile, bulk update is used. In WEB-CLI, the Required fields accept the range 1–100. - Where it is opened WEB-CLI →
lb hc update/lb hc update-many(lb hc · The Threshold Fields Found in Every Type) - Requirement WEB-CLI access; the profile ID (
lb hc list) - vService type All
Step-by-Step Configuration
lb hc update id <profile-id> --testInterval 5 --timeout 3 --requiredSuccess 3 --requiredFailure 3For a bulk update, the command below is written; the profiles are marked in the list that opens and confirmation is given:
lb hc update-many target selected --requiredFailure 3Verification
The profile record is displayed.
lb hc show <profile-id>testInterval 5, timeout 3, requiredSuccess 3, requiredFailure 3Common Mistakes
- Setting Period or Timeout to 120 seconds or more. These values are applied as 1 second.
- Lowering Period below 1 second. In types other than Ping, at least 1 second is waited between two checks; there is no gain.
- Trying to solve flapping only with Period. Stability is provided by Required successes and Required failures (The health check keeps going back and forth between up/down (flapping); what should I do?).
- Changing the profile at a busy hour. All the Backend Services that use the profile return to Preparing at the same time; for a gradual move, Method 2 is used.
How it is done in the documentation
