Skip to content

Commit 47ea2ef

Browse files
excelle08meta-codesync[bot]
authored andcommitted
Make prod-aligned knobs the defaults (#712)
Summary: Pull Request resolved: #712 Bake in four knobs that were previously env-overrides during the t29-t34 calibration sweeps. These are the configurations that bring the FeedSim profile closest to prod multifeed_aggregator on CPL/BGM/Grace (validated in t34, see T269255604): - `--rpc_fanout_scale` default 0.025 → 0.10 (LeafNodeRankCmdline.ggo) - ~94 → ~376 outbound RPCs/session - Raises Encryption / RPC-Compression / RPC-AsyncIO shares (which all flow through the TLS+ZSTD mock_services channel) toward prod's 3.3% / 2.9% / 14.4% on BGM - `FEEDSIM_SLA_P95_MS` default 500 → 700 (run.sh) - Matches prod multifeed_aggregator's own end-to-end p95 budget - `FEEDSIM_TLS` default 0 → 1 (run.sh, run-feedsim-multi.sh) - TLS on mock_services channel by default (Rocket-over-TLS, ALPN "rs") - `MOCK_KEEPALIVE_INTERVAL_MS` default unset → 100 (run.sh) - 100 ms getStatus() pings on every channel to defeat the cold-channel anti-pattern (t25 showed BGM 14x p95 cliff at q=5 without keepalive) All four remain env-overridable for experiments (set to 0 / different value to opt out). Reviewed By: YifanYuan3 Differential Revision: D107579495
1 parent f091ac6 commit 47ea2ef

3 files changed

Lines changed: 27 additions & 26 deletions

File tree

packages/feedsim/run-feedsim-multi.sh

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -164,11 +164,12 @@ function start_mock_services() {
164164
local offset_us="${MOCK_LATENCY_OFFSET_US:-0}"
165165
local skip_us="${MOCK_LATENCY_SKIP_THRESHOLD_US:-100}"
166166

167-
# TLS opt-in: FEEDSIM_TLS=1 enables TLS on both server and client.
168-
# Server reads --tls_cert / --tls_key; client picks up MOCK_TLS env var
169-
# (LeafNodeRank uses gengetopt and rejects unknown CLI flags).
167+
# TLS on by default (matches prod's Rocket-over-TLS); set FEEDSIM_TLS=0
168+
# to disable. Server reads --tls_cert / --tls_key; client picks up
169+
# MOCK_TLS env var set by run.sh (LeafNodeRank uses gengetopt and rejects
170+
# unknown CLI flags).
170171
local tls_opts=""
171-
if [ "${FEEDSIM_TLS:-0}" = "1" ]; then
172+
if [ "${FEEDSIM_TLS:-1}" = "1" ]; then
172173
local cert_dir="${FEEDSIM_ROOT}/certs"
173174
if [ ! -r "${cert_dir}/example.crt" ] || [ ! -r "${cert_dir}/example.key" ]; then
174175
echo "ERROR: FEEDSIM_TLS=1 but ${cert_dir}/example.{crt,key} not found" >&2
@@ -177,7 +178,7 @@ function start_mock_services() {
177178
tls_opts="--tls_cert=${cert_dir}/example.crt --tls_key=${cert_dir}/example.key"
178179
fi
179180

180-
echo "Starting mock_services on port ${port} (cores=${core_range}, io_threads=${io_threads}, cap_us=${cap_us}, offset_us=${offset_us}, skip_us=${skip_us}, tls=${FEEDSIM_TLS:-0}, silesia=${SILESIA_DIR_ABS})"
181+
echo "Starting mock_services on port ${port} (cores=${core_range}, io_threads=${io_threads}, cap_us=${cap_us}, offset_us=${offset_us}, skip_us=${skip_us}, tls=${FEEDSIM_TLS:-1}, silesia=${SILESIA_DIR_ABS})"
181182
# shellcheck disable=SC2086
182183
taskset --cpu-list "$core_range" \
183184
"$MOCK_SERVICES_BIN" \

packages/feedsim/run.sh

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -735,8 +735,8 @@ main() {
735735
local mock_port="${MOCK_SERVICES_PORT:-21222}"
736736
local mock_services_opts="--rpc_dist_path=$rpc_dist_json --mock_services_host=localhost --mock_services_port=${mock_port}"
737737
# Optional fanout-scale override (defaults to LeafNodeRank's
738-
# --rpc_fanout_scale=0.025 when the env var is unset). Lets sweep
739-
# scripts A/B test heavier outbound load without rebuilding.
738+
# --rpc_fanout_scale=0.10 when the env var is unset). Lets sweep
739+
# scripts A/B test different outbound load levels without rebuilding.
740740
if [ -n "${RPC_FANOUT_SCALE:-}" ]; then
741741
mock_services_opts="$mock_services_opts --rpc_fanout_scale=${RPC_FANOUT_SCALE}"
742742
echo "RPC fanout scale override: $RPC_FANOUT_SCALE"
@@ -752,23 +752,24 @@ main() {
752752
mock_services_opts="$mock_services_opts --use_legacy_sleep"
753753
echo "RPC fanout: forced OFF via LEAFNODE_USE_LEGACY_SLEEP=1 (legacy sleep path)"
754754
fi
755-
# t25 mitigation knob: per-MockServicesClient keepalive ping. When
756-
# MOCK_KEEPALIVE_INTERVAL_MS is set and > 0, each channel issues a
757-
# 1-byte getStatus() probe every N ms to defeat the cold-channel
758-
# anti-pattern observed at low QPS (BGM saw 14x p95 cliff at q=5).
759-
# Recommended starting value: 150-500 ms. 0 / unset = disabled
760-
# (anti-pattern stays observable).
761-
if [ -n "${MOCK_KEEPALIVE_INTERVAL_MS:-}" ] && [ "${MOCK_KEEPALIVE_INTERVAL_MS}" != "0" ]; then
762-
mock_services_opts="$mock_services_opts --mock_keepalive_interval_ms=${MOCK_KEEPALIVE_INTERVAL_MS}"
763-
echo "MockServicesClient keepalive: ENABLED (interval=${MOCK_KEEPALIVE_INTERVAL_MS} ms)"
755+
# Per-MockServicesClient keepalive ping. Each channel issues a tiny
756+
# getStatus() probe every N ms to defeat the cold-channel anti-pattern
757+
# observed at low QPS (BGM saw 14x p95 cliff at q=5 without keepalive).
758+
# Default 100 ms. Set MOCK_KEEPALIVE_INTERVAL_MS=0 to disable.
759+
mock_keepalive_ms="${MOCK_KEEPALIVE_INTERVAL_MS:-100}"
760+
if [ "${mock_keepalive_ms}" != "0" ]; then
761+
mock_services_opts="$mock_services_opts --mock_keepalive_interval_ms=${mock_keepalive_ms}"
762+
echo "MockServicesClient keepalive: ENABLED (interval=${mock_keepalive_ms} ms)"
764763
fi
765764
# TLS + wire compression on the outbound MockServicesClient channel.
766765
# LeafNodeRank uses gengetopt (rejects unknown CLI flags), so these knobs
767766
# are plumbed via env vars MOCK_TLS / MOCK_COMPRESS_ZSTD read inside
768-
# MockServicesClient.cc. FEEDSIM_TLS=1 must match the server-side
769-
# --tls_cert/--tls_key wiring in run-feedsim-multi.sh. FEEDSIM_NO_RPC_ZSTD=1
770-
# disables ZSTD (binary default is on); leave unset for prod-parity.
771-
if [ "${FEEDSIM_TLS:-0}" = "1" ]; then
767+
# MockServicesClient.cc. FEEDSIM_TLS defaults to 1 (matches prod's
768+
# Rocket-over-TLS); set FEEDSIM_TLS=0 to disable. Server-side
769+
# --tls_cert/--tls_key wiring is in run-feedsim-multi.sh.
770+
# FEEDSIM_NO_RPC_ZSTD=1 disables ZSTD (binary default is on); leave
771+
# unset for prod-parity.
772+
if [ "${FEEDSIM_TLS:-1}" = "1" ]; then
772773
export MOCK_TLS=1
773774
echo "MockServicesClient TLS: ENABLED (via MOCK_TLS env)"
774775
fi
@@ -889,11 +890,10 @@ main() {
889890
# Preprocessing complete; search_qps.sh will own the main_benchmark phase.
890891
log_preprocessing_end "$BREAKDOWN_FOLDER" "$$"
891892

892-
# SLA target for search_qps (95p latency in milliseconds). Default 500ms.
893-
# Override via FEEDSIM_SLA_P95_MS env var. Prior experiments (t29, t30)
894-
# ran at 700ms to give the system more headroom past the prod-aggregator's
895-
# own end-to-end budget.
896-
sla_p95_ms="${FEEDSIM_SLA_P95_MS:-500}"
893+
# SLA target for search_qps (95p latency in milliseconds). Default 700ms
894+
# matches the prod multifeed aggregator's own end-to-end budget at p95.
895+
# Override via FEEDSIM_SLA_P95_MS env var.
896+
sla_p95_ms="${FEEDSIM_SLA_P95_MS:-700}"
897897
sla_arg="95p:${sla_p95_ms}"
898898

899899
if [ -z "$fixed_qps" ] && [ "$auto_driver_threads" != "1" ]; then

packages/feedsim/third_party/src/workloads/ranking/LeafNodeRankCmdline.ggo

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ option "silesia_dir" - "Path to Silesia corpus directory. When set, server-side
9191
option "rpc_dist_path" - "Path to rpc_dist.json. When set, request handlers fan out real RPCs to mock_services." string typestr="filename" default=""
9292
option "mock_services_host" - "Hostname for mock_services Thrift server." string default="127.0.0.1"
9393
option "mock_services_port" - "Port for mock_services Thrift server (matches mock_services --port)." int default="21222"
94-
option "rpc_fanout_scale" - "Scale factor applied to per-session fanout counts. Default 0.025 yields ~94 RPCs/session (vs ~3742 at scale=1.0)." double default="0.025"
94+
option "rpc_fanout_scale" - "Scale factor applied to per-session fanout counts. Default 0.10 yields ~376 RPCs/session (vs ~3742 at scale=1.0); calibrated to raise outbound RPC volume so Encryption/RPC-Compression/RPC-AsyncIO shares match prod's multifeed_aggregator profile." double default="0.10"
9595
# Diagnostic / isolation knob. When set, request handlers take the legacy
9696
# folly::futures::sleep path even if --rpc_dist_path is supplied, and the
9797
# per-thread MockServicesClient is not constructed (no connection to

0 commit comments

Comments
 (0)