Reduce connection latency for cluster clients

Former-commit-id: f1acee99bdaee4faf9e18cdf4734d51a73e78a41
This commit is contained in:
John Sully 2021-04-07 15:49:58 +00:00
parent 1bf5477602
commit 86a5b2fbc7

View File

@ -1259,7 +1259,9 @@ void acceptOnThread(connection *conn, int flags, char *cip)
}
else
{
ielTarget = chooseBestThreadForAccept();
// Cluster connections are more transient, so its not worth the cost to balance
// we can trust that SO_REUSEPORT is doing its job of distributing connections
ielTarget = g_pserver->cluster_enabled ? ielCur : chooseBestThreadForAccept();
}
rgacceptsInFlight[ielTarget].fetch_add(1, std::memory_order_relaxed);