Configuring Timeouts

To limit how long Linkerd will wait before failing an outgoing request toanother service, you can configure timeouts. These work by adding a little bitof extra information to the service profile forthe service you're sending requests to.

Each route may define a timeout which specifies the maximum amount of time towait for a response (including retries) to complete after the request is sent.If this timeout is reached, Linkerd will cancel the request, and return a 504response. If unspecified, the default timeout is 10 seconds.

  1. spec:
  2. routes:
  3. - condition:
  4. method: HEAD
  5. pathRegex: /authors/[^/]*\.json
  6. name: HEAD /authors/{id}.json
  7. timeout: 300ms

Check out the timeouts section of the books demo fora tutorial of how to configure timeouts.

Monitoring Timeouts

Requests which reach the timeout will be canceled, return a 504 Gateway Timeoutresponse, and count as a failure for the purposes of effective successrate. Since the request wascanceled before any actual response was received, a timeout will not counttowards the actual request volume at all. This means that effective requestrate can be higher than actual request rate when timeouts are configured.Furthermore, if a response is received just as the timeout is exceeded, it ispossible for the request to be counted as an actual success but an effectivefailure. This can result in effective success rate being lower than actualsuccess rate.