joe-elliott / hedgedhttp

Hedged HTTP client which helps to reduce tail latency at scale.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

hedgedhttp

build-img pkg-img reportcard-img coverage-img

Hedged HTTP client which helps to reduce tail latency at scale.

Rationale

See paper Tail at Scale by Jeffrey Dean, Luiz André Barroso. In short: the client first sends one request, but then sends an additional request after a timeout if the previous hasn't returned an answer in the expected time. The client cancels remaining requests once the first result is received.

Acknowledge

Thanks to Bohdan Storozhuk for the review and powerful hints.

Features

  • Simple API.
  • Easy to integrate.
  • Optimized for speed.
  • Clean and tested code.
  • Dependency-free.

Install

Go version 1.16+

go get github.com/cristalhq/hedgedhttp

Example

TODO

Documentation

See these docs.

License

MIT License.

About

Hedged HTTP client which helps to reduce tail latency at scale.

License:MIT License


Languages

Language:Go 100.0%