motiv-labs / janus

An API Gateway written in Go
https://hellofresh.gitbooks.io/janus
MIT License
2.79k stars 318 forks source link

Periodically clear http keep-alive connections #403

Closed s4nji closed 5 years ago

s4nji commented 5 years ago

Adds a new optional environment variable CONN_PURGE_INTERVAL that periodically clears http keep-alive connections on the proxy.

This is done to limit the errors that occur when a dns change happens on a target host of an endpoint. If this endpoint is under constant load, the connection (with stale dns) will likely be used forever, as IDLE_CONN_TIMEOUT of 90 seconds will never be reached.

codecov[bot] commented 5 years ago

Codecov Report

Merging #403 into master will decrease coverage by 0.1%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #403      +/-   ##
==========================================
- Coverage   40.37%   40.27%   -0.11%     
==========================================
  Files          75       75              
  Lines        2635     2642       +7     
==========================================
  Hits         1064     1064              
- Misses       1509     1516       +7     
  Partials       62       62
Impacted Files Coverage Δ
pkg/config/specification.go 61.11% <ø> (ø) :arrow_up:
pkg/proxy/register_options.go 0% <0%> (ø) :arrow_up:
pkg/proxy/register.go 0% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 08b9769...dde9468. Read the comment docs.

codecov[bot] commented 5 years ago

Codecov Report

Merging #403 into master will decrease coverage by 0.1%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #403      +/-   ##
==========================================
- Coverage   40.37%   40.27%   -0.11%     
==========================================
  Files          75       75              
  Lines        2635     2642       +7     
==========================================
  Hits         1064     1064              
- Misses       1509     1516       +7     
  Partials       62       62
Impacted Files Coverage Δ
pkg/config/specification.go 61.11% <ø> (ø) :arrow_up:
pkg/proxy/register_options.go 0% <0%> (ø) :arrow_up:
pkg/proxy/register.go 0% <0%> (ø) :arrow_up:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 08b9769...a7998d5. Read the comment docs.

vgarvardt commented 5 years ago

👍

Approved with Zappr Approved with Zappr Approved with Zappr

aleksandrzhiliaev commented 5 years ago

+1

Approved with Zappr Approved with Zappr Approved with Zappr Approved with Zappr