Skip to content

Commit 4fba373

Browse files
excelle08meta-codesync[bot]
authored andcommitted
Drop max(1, ...) floor in issueOutboundFanout (#730)
Summary: Pull Request resolved: #730 issueOutboundFanout previously rounded the per-method call count via std::max(1, round(perSessionCounts[i] * scale)). At the default --rpc_fanout_scale=0.025, methods with perSessionCounts() < 20 (the long-tail outbound RPCs production hits about once per 200 sessions) ended up appearing once per session. That inflated the per-method ratio of slow-but-infrequent methods relative to their production frequency, and the inflated tail samples dominated the aggregate fanout latency distribution observed by issueOutboundFanout's collectAll. Replace the floor with a clean drop: round to the nearest integer, then continue if the result is zero. Methods whose expected per-session count is below 0.5/scale (= 20 at default scale) are skipped entirely instead of being over-represented at one call per session. Reviewed By: YifanYuan3 Differential Revision: D105119225 fbshipit-source-id: 8300d8953ac8f79e4326b302093b36cf296dc5c6
1 parent ec83aa2 commit 4fba373

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

packages/feedsim/third_party/src/workloads/ranking/LeafNodeRank.cc

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -738,10 +738,17 @@ static folly::Future<int> issueOutboundFanout(
738738

739739
for (size_t i = 0; i < ranking::kNumMethods; ++i) {
740740
auto m = static_cast<ranking::MethodIdx>(i);
741-
int n = std::max(
742-
1,
743-
static_cast<int>(
744-
std::round(ranking::perSessionCounts()[i] * scale)));
741+
// Round to the nearest integer call count and skip methods that don't
742+
// round up to at least 1. The previous std::max(1, ...) floor inflated
743+
// the share of low-weighted but slow methods (e.g. tail-latency outliers
744+
// that production hits ~once per 200 sessions) to once-per-session at
745+
// small --rpc_fanout_scale, which distorted both the per-method ratios
746+
// and the aggregate latency distribution toward the slow tail.
747+
int n = static_cast<int>(
748+
std::round(ranking::perSessionCounts()[i] * scale));
749+
if (n == 0) {
750+
continue;
751+
}
745752

746753
const auto& req_sampler = td.rpc_registry->requestSize(m);
747754
const auto& resp_sampler = td.rpc_registry->responseSize(m);

0 commit comments

Comments
 (0)