Repository navigation
feat: add scripts/load_test.py for /v1/decisions throughput and latency - #10
Merged
Merged
Conversation
…v1/decisions Standard library only. Loops clients on keep-alive connections with a three-question request, in two modes: unique (a fresh state per request) and identical (one body, which the prefix cache flatters). Reports requests per second, p50/p95/p99, statuses and the prefix-cache hit rate from /metrics. TESTING.md says how to run it and how to read it, including that --backoff is needed to model a caller that waits after a 503. Assisted-by: Claude Code Signed-off-by: Nigel Jones <jonesn@uk.ibm.com>
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.
What changes for users
A deployer can measure how many decision requests per second their server handles, and at what latency, with one command and no dependencies. The script takes the server's URL; nothing in it points at a particular endpoint.
Mechanism
scripts/load_test.pyruns N clients, each on one keep-alive connection, sending a three-question request (predicate, 20-way choice, 5-level score) over a state of about 230 tokens.--mode uniquegives each request a fresh state;--mode identicalrepeats one body, which the prefix cache serves almost entirely and so overstates throughput. It prints requests per second, p50/p95/p99 and the HTTP statuses per level, and the prefix-cache hit rate from vLLM's/metricswhen present.docs/TESTING.mdexplains how to run it and how to read the results, including the effect ofSYSTEMONE_MAX_CONCURRENT_REQUESTS(503s, not queueing) and--backoff.Limitations
--loadofprobe_check.py(identical body, three levels, with chat alongside); this one adds unique content, more levels and the cache hit rate.Testing
ruff,ty checkand the existing suite pass.--backoff, the prefix-cache line, and the error messages for a bad URL, bad levels, an unreachable host and a missing argument.