Skip to content

Commit

Permalink
Pin shadow requests to specific proxy threads
Browse files Browse the repository at this point in the history
Summary: Shadow requests are pinned to specific threads based on destination host when routed via `SRRoute` and `jump_threads=True`. This greatly reduces the number of connections to the shadow tier.

Reviewed By: stuclar

Differential Revision: D66558771

fbshipit-source-id: b501a126614732de52cf4d16ce004f6872348a14
  • Loading branch information
Emanuele Altieri authored and facebook-github-bot committed Dec 10, 2024
1 parent e10ed6b commit 9b6c365
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mcrouter/routes/ShadowRoute-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ void ShadowRoute<RouterInfo, ShadowPolicy>::dispatchShadowRequest(
// we don't want to spool shadow requests
fiber_local<RouterInfo>::clearAsynclogName();
fiber_local<RouterInfo>::addRequestClass(RequestClass::kShadow);
// pin shadow requests to specific threads based on destination
fiber_local<RouterInfo>::enableJumpThreads();
const auto shadowReply = shadow->route(*adjustedReq);
if (postShadowReplyFn) {
postShadowReplyFn(shadowReply);
Expand Down

0 comments on commit 9b6c365

Please sign in to comment.