nghttpx: Randomize backend address round robin order per thread
This commit is contained in:
parent
11d0533cfc
commit
fdcdb21c38
|
@ -304,6 +304,9 @@ void Worker::replace_downstream_config(
|
||||||
shared_addr->http1_pri.weight = num_http1;
|
shared_addr->http1_pri.weight = num_http1;
|
||||||
shared_addr->http2_pri.weight = num_http2;
|
shared_addr->http2_pri.weight = num_http2;
|
||||||
|
|
||||||
|
std::shuffle(std::begin(shared_addr->addrs), std::end(shared_addr->addrs),
|
||||||
|
randgen_);
|
||||||
|
|
||||||
if (shared_addr->affinity.type != SessionAffinity::NONE) {
|
if (shared_addr->affinity.type != SessionAffinity::NONE) {
|
||||||
for (auto &addr : shared_addr->addrs) {
|
for (auto &addr : shared_addr->addrs) {
|
||||||
addr.dconn_pool = std::make_unique<DownstreamConnectionPool>();
|
addr.dconn_pool = std::make_unique<DownstreamConnectionPool>();
|
||||||
|
|
Loading…
Reference in New Issue