health_​detection

Version: v2025-01-13Includes use: Yes

Behavior name: Origin Health Detection

Monitors the health of your origin server by tracking unsuccessful attempts to contact it. Use this behavior to keep end users from having to wait several seconds before a forwarded request times out, or to reduce requests on the origin server when it is unavailable.

When client requests are forwarded to the origin, the edge server tracks the number of attempts to connect to each IP address. It cycles through IP addresses in least-recently-tested order to avoid hitting the same one twice in a row. If the number of consecutive unsuccessful tests reaches a threshold you specify, the behavior identifies the address as faulty and stops sending requests. The edge server returns an error message to the end user or else triggers any fail_action behavior you specify.

Default behavior

These samples reflect the behavior's default settings. You can use these as is in your configurations or make adjustments based on the behavior's available options.

data "akamai_property_rules_builder" "health_detection" {
  rules_v2025_02_18 {
    name     = "Origin Health Detection"
    comments = "Identifies faulty addresses and stops sending requests."
    behavior {
      health_detection {
        retry_count        = 3
        retry_interval     = "60s"
        maximum_reconnects = 2
      }
    }
  }
}
"behaviors": [
  {
  "name": "healthDetection",
  "options": {
    "retryCount": 3,
    "retryInterval": "60s",
    "maximumReconnects": 2
    }
  }
]

Options

Option Description
retry_count
The number of consecutive connection failures that mark an IP address as faulty.
retry_interval
Specifies the amount of time the edge server will wait before trying to reconnect to an IP address it has already identified as faulty.
maximum_reconnects
Specifies the maximum number of times the edge server will contact your origin server. If your origin is associated with several IP addresses, maximum_reconnects effectively overrides the value of retry_count.