uber / tchannel

network multiplexing and framing protocol for RPC
MIT License
1.15k stars 129 forks source link

peer selection should favor least outgoing reqs #1346

Closed Raynos closed 9 years ago

Raynos commented 9 years ago

We had a bug in PreferIncoming where we "generalized" the direction too much.

We should always favor a peer with least outgoing because we want to measure and pick the peer with the lowest P99 latency which we are doing by least pending requests (i.e. more pending requests === bigger latency)

r: @jcorbin @kriskowal

cc @shannili

kriskowal commented 9 years ago

:ok:

jcorbin commented 9 years ago

Good catch, I must've missed it while reviewing @ShanniLi 's recent work that we even added a direction argument down the pending weight path... this was always intended to be out only, pending in doesn't mean much from a peer selection standpoint.

jcorbin commented 9 years ago

also: lgtm, land it once tests green

ShanniLi commented 9 years ago

:+1: