How many seconds does it take for a health check result to affect traffic?
Short answer
Two durations are added together: the forming of the decision and the application of the decision to traffic. The decision is formed after Required Failures (or Required Successes) consecutive checks (How many seconds does it take for a server to be considered "down", and how do I calculate it?). In HTTP and L7 TCP vServices, the health result is applied to traffic once every 2.5 seconds, meaning that at most 2.5 seconds are added. In a Network vService (TCP - L4, UDP - L4; Port Range off), removing the server takes at most about 9 seconds, and taking it back takes at most 5 seconds. In Network vServices with Protocol ANY - L3 or with Port Range on, the health result is not reflected in the distribution.
How Does It Work?
| vService | Effect of the decision on traffic |
|---|---|
| HTTP, L7 TCP | The health result is read once every 2.5 seconds; at most 2.5 s |
| Network (TCP - L4, UDP - L4; Port Range off) | The health result is read once every 5 seconds; when the result gets worse, it is read once more 4 seconds later and the server is removed: removal takes at most about 9 s, taking back at most 5 s |
| Network (ANY - L3 or Port Range on) | Not reflected; distribution does not take the health status into account |
New or changed profile: When a health check is newly assigned or the profile is changed, the Backend Service switches to the Preparing status and does not receive traffic during this time; it enters traffic after Required Successes consecutive successful checks. Since a profile change returns all the Backend Services that use the profile to Preparing at the same time, it is done at a low-traffic time (If I change a health check profile, which Backend Services are affected?).
Open connections: When the server becomes Error, only new connections go to other servers; open connections continue until they close on their own.
In TR7
- Display on the screen: The Health indicator in the Backend Services list and the preview receive the result with short delays; the status on the screen may differ by a few seconds from the status applied to traffic.
- History: The times of the status transitions are seen in the Health Checks tab of the Backend Service, and the time series in the Health Check State panel on the Dashboard.
- Cluster: Each device performs the check itself and applies its own result to its own traffic; the results of the two devices may differ for a short time.
Common Misconceptions
- "Traffic is cut the moment the Health indicator turns red." Applying the decision to traffic can take up to 2.5 seconds in HTTP and L7 TCP, and up to about 9 seconds in Network.
- "When it is marked down, open connections are also cut." New connections go to other servers; open connections continue until they close on their own.
- "A health check is always applied in a Network vService." It is not applied with ANY - L3 or while Port Range is on.
How it is done in the documentation
