Skip to content

Commit 1668c83

Browse files
excelle08meta-codesync[bot]
authored andcommitted
Raise default --io_threads (ThriftSrv.IO pool) from 4 to nproc (#738)
Summary: Pull Request resolved: #738 EVENTBASE_THREADS_DEFAULT in run.sh has been hard-coded at 4 since the original oldisim-based feedsim. That made sense back when the only outbound work was a synthetic folly::futures::sleep — 4 EventBases handling sleep timers were plenty. After Phase 5 (mock_services + issueOutboundFanout) each dispatcher's outbound RPC fanout is pinned to a single MockServicesClient on a single EventBase, so the system effectively had only 4 active EventBases serving all outbound RPCs. With --rpc_fanout_scale=0.10 producing ~376 RPCs per request, those 4 EBs queue-saturate hard: dispatch_per_rpc averaged 753ms while mock_handler_actual averaged 4.2ms — the 749ms gap is pure EventBase queueing. The SREventBase pool is sized 0.7*nproc precisely to host the outbound fanout, but with only 4 dispatcher EventBases owning MockClient instances, only 4 of the 61 SREventBase threads on BGM see actual work. Raising EVENTBASE_THREADS_DEFAULT to nproc spreads dispatcher EventBases across all cores so the per-thread MockServicesClient instances also span the SREventBase pool, fixing the 4-vs-61 mismatch. This is also a long-standing flaw in the original feedsim that becomes visible only once outbound RPC work is realistic — keeping 4 was masking the bottleneck behind synthetic sleeps. Reviewed By: YifanYuan3 Differential Revision: D105119223
1 parent e33f344 commit 1668c83

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/feedsim/run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ source "${BENCHPRESS_ROOT}/packages/common/runtime_breakdown_utils.sh"
4646
# will risk running out of memory and getting killed
4747
IS_SMT_ON="$(cat /sys/devices/system/cpu/smt/active)"
4848
THRIFT_THREADS_DEFAULT="$(echo "${BC_MIN_FN}; min($(nproc), 216)" | bc)"
49-
EVENTBASE_THREADS_DEFAULT=4 # 4 should suffice. Tune up if threads are saturated.
49+
EVENTBASE_THREADS_DEFAULT="$(nproc)" # nproc threads so the ThriftSrv.IO pool isn't a 4-EB bottleneck. Each EB owns its own MockServicesClient so outbound RPC fanout (issueOutboundFanout) actually spreads across the SREventBase pool instead of serializing through 4 EBs.
5050
SRV_THREADS_DEFAULT=8 # 8 should also suffice for most purposes
5151
if [[ "$IS_SMT_ON" = 1 ]]; then
5252
RANKING_THREADS_DEFAULT="$(( $(nproc) * 7/20))" # 7/20 is 0.35 cpu factor

0 commit comments

Comments
 (0)