Ability to disable connection pooling on route level
#2418 aperta il 27 ott 2021
Metriche repository
- Star
- (4284 star)
- Metriche merge PR
- (Merge medio 1g 21h) (18 PR mergiate in 30 g)
Descrizione
Is your feature request related to a problem? Please describe.
These days k8s is a popular solution. In the default setup typical communication looks like this: http client with connection pooling -> Kubernetes Service (which is implemented by kube-proxy - L4 load balancer) -> http server. Connection pooling + L4 Load Balancing isn't an optimal combination. Traffic can be unevenly distributed accross instances. Implementing L7 Load Balancer (through service mesh) can be costly.
Describe the solution you'd like
Ability to set up a pool mode (or just a flag - disabled/enabled) in route's metadata just like netty's connect-timeout / response-timeout. Eg. pool-mode?
Describe alternatives you've considered
- Setting up
SetRequestHeader=Connection, Closeon route, which can effectively disable connection pooling. Unfortunately this doesn't work because ofRemoveHopByHopHeaders Filter. It truncatesConnectionheader event if it's added by configuration. Anyway - i'm not 100% sure if adding this header has under the hood exactly the same effect as just disabling connection pooling on http client. - Setting up
Connectionheader by upstream in a response. But also as in alternative above i don't know if this doesn't causes another issues related to http pipelining etc. - Configuring ribbon in pod-communication mode. But we want to avoid that, because there is some eventual consistency between pod's state local copy in gateway and actual state, which causes sending requests to already dead pods during upstream rollout.