You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Bound issueOutboundFanout per-request concurrency with folly::window(K=32) (#732)
Summary:
Pull Request resolved: #732
issueOutboundFanout used to issue all ~376 RPCs (at --rpc_fanout_scale=0.10) in a tight loop, queueing them all onto the per-thread MockServicesClient EventBase at once. Even with the io_threads=88 fix spreading dispatcher EBs across the SREventBase pool, each individual request still produced a 376-RPC burst on one EB. Debug histograms showed the consequence: dispatch_per_rpc averaged ~500ms while mock_handler_actual averaged ~4ms — the 496ms gap is pure EB queue depth.
Switch issueOutboundFanout to folly::window(executor=srEventBasePool, specs, fn, K=32). window() issues K up-front and refills as each completes, capping per-request EB queue depth at K instead of N. To keep the windowed lambda thread-safe without taking RNG locks, the per-RPC sampling (req_size, resp_size, lat_us) and Silesia-padded request body construction now happens up-front on the dispatcher thread; the lambda only does the dispatchByEnum() call and the histogram bookkeeping.
K=32 was picked to be small enough to keep the EB queue shallow (~150ms drain at 5ms/RPC) while still amortizing window's per-call coordination overhead.
Reviewed By: YifanYuan3
Differential Revision: D105119221
0 commit comments