proof of concept: benchmark long polling latency vs current short polling#137
Open
kirinrastogi wants to merge 5 commits intomainfrom
Open
proof of concept: benchmark long polling latency vs current short polling#137kirinrastogi wants to merge 5 commits intomainfrom
kirinrastogi wants to merge 5 commits intomainfrom
Conversation
Measures the delay between enqueuing a task and a worker picking it up using short polling. With pollIntervalMs=50, the average latency is ~535ms which demonstrates the need for long polling.
…vers - Fix client RPC timeout: protobuf-ts GrpcTransport reads `timeout`, not `deadline`, from RpcOptions. The `deadline` field was silently ignored, leaving long-poll RPCs without a client-side timeout. - Pin each long-poll poller to a fixed server index. Unlike short polling which cycles rapidly through servers, long-poll requests block for the full timeout duration, so cycling caused pollers to miss tasks on the server they weren't currently polling. - Add `serverCount` getter to SiloGRPCClient for topology-aware poller configuration. - Add integration tests: direct two-enqueue RPC test and 10-iteration worker latency test (avg ~225ms vs ~535ms with short polling).
Extract short-poll and long-poll latency benchmarks into a dedicated bench file using vitest bench. Keep the long-poll correctness test in integration tests.
…ndex Route long-poll requests by shard so the test works regardless of cluster topology. Also fix rustfmt and make resolveShard public.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Still need to take a look at what this means for routing. Temporal uses long polling, and it can help here, in the best case it may reduce latency by 50ms.
5 runs with 10 enqueues each, running
pnpm benchfrom the typescript_client dir in a loop and summarizing the results:actual output for one run: