@@ -2322,9 +2322,13 @@ load-test-agentgateway-mcp-server-time: ## Load test external MCP server (loc
23222322MCP_PROTOCOL_LOCUSTFILE ?= tests/loadtest/locustfile_mcp_protocol.py
23232323MCP_RATE_LIMITER_LOCUSTFILE ?= tests/loadtest/locustfile_rate_limiter_backend_correctness.py
23242324MCP_RATE_LIMITER_SCALE_LOCUSTFILE ?= tests/loadtest/locustfile_rate_limiter_scale.py
2325+ MCP_RATE_LIMITER_REDIS_CAPACITY_LOCUSTFILE ?= tests/loadtest/locustfile_rate_limiter_redis_capacity.py
23252326RL_ALGORITHM ?= fixed_window
23262327RL_USERS ?= 100
23272328RL_SPAWN_RATE ?= 10
2329+ RL_REQS_PER_SECOND ?= 0.25
2330+ RL_PROMPT_ID ?=
2331+ RATE_LIMITER_FORCE_PYTHON ?=
23282332MCP_PROTOCOL_HOST ?= http://localhost:4444
23292333MCP_BENCHMARK_HOST ?= http://localhost:8080
23302334MCP_BENCHMARK_SERVER_ID ?= 9779b6698cbd4b4995ee04a4fab38737
@@ -2445,7 +2449,7 @@ benchmark-rate-limiter: ## Rate limiter correctness test (1
24452449# help: benchmark-rate-limiter-scale - Multi-user scale test showing Redis memory divergence across algorithms
24462450.PHONY : benchmark-rate-limiter-scale
24472451RL_RUN_TIME ?= 300s
2448- benchmark-rate-limiter-scale : # # Scale test: 500 unique users, Redis memory timeline per algorithm
2452+ benchmark-rate-limiter-scale : # # Scale test: RL_USERS unique users (default 100) , Redis memory timeline per algorithm
24492453 @echo " 📈 Running rate limiter scale test (resource divergence)..."
24502454 @echo " Algorithm: $( RL_ALGORITHM) (must match plugins/config.yaml)"
24512455 @echo " Users: $( RL_USERS) unique identities (each creates own Redis key)"
@@ -2475,6 +2479,47 @@ benchmark-rate-limiter-scale: ## Scale test: 500 unique users, Red
24752479 --only-summary \
24762480 ScaleComparisonUser || true'
24772481
2482+
2483+ # help: benchmark-rate-limiter-redis-capacity - Multi-instance prompt-path concurrency benchmark for Redis rate limiting
2484+ .PHONY : benchmark-rate-limiter-redis-capacity
2485+ benchmark-rate-limiter-redis-capacity : # # Capacity test: 3 gateways + Redis on prompt_pre_fetch path
2486+ @echo " 🚀 Running rate limiter Redis capacity test..."
2487+ @echo " Host: $( MCP_BENCHMARK_HOST) "
2488+ @echo " Topology: nginx -> 3 gateways -> shared Redis"
2489+ @echo " Path: REST /prompts/{id} (prompt_pre_fetch)"
2490+ @echo " Users: $( RL_USERS) "
2491+ @echo " Spawn rate: $( RL_SPAWN_RATE) /s"
2492+ @echo " Pace: $( RL_REQS_PER_SECOND) req/s per user"
2493+ @echo " Duration: $( RL_RUN_TIME) "
2494+ @test -d " $( VENV_DIR) " || $(MAKE ) venv
2495+ @/bin/bash -eu -o pipefail -c ' source $(VENV_DIR)/bin/activate && \
2496+ LOCUST_LOG_LEVEL=ERROR \
2497+ RATE_LIMITER_FORCE_PYTHON=$(RATE_LIMITER_FORCE_PYTHON ) \
2498+ RL_USERS=$(RL_USERS ) \
2499+ RL_SPAWN_RATE=$(RL_SPAWN_RATE ) \
2500+ RL_RUN_TIME=$(RL_RUN_TIME ) \
2501+ RL_REQS_PER_SECOND=$(RL_REQS_PER_SECOND ) \
2502+ RL_LIMIT_PER_MIN=$(RL_LIMIT_PER_MIN ) \
2503+ RL_PROMPT_ID=$(RL_PROMPT_ID ) \
2504+ locust -f $(MCP_RATE_LIMITER_REDIS_CAPACITY_LOCUSTFILE ) \
2505+ --host=$(MCP_BENCHMARK_HOST ) \
2506+ --users=$(RL_USERS ) \
2507+ --spawn-rate=$(RL_SPAWN_RATE ) \
2508+ --run-time=$(RL_RUN_TIME ) \
2509+ --headless \
2510+ --only-summary \
2511+ CapacityPromptUser || true'
2512+
2513+ # help: benchmark-rate-limiter-capacity-rust - Capacity test with Rust engine enabled (default)
2514+ .PHONY : benchmark-rate-limiter-capacity-rust
2515+ benchmark-rate-limiter-capacity-rust : # # Capacity test with Rust engine
2516+ RATE_LIMITER_FORCE_PYTHON=0 $(MAKE ) benchmark-rate-limiter-redis-capacity
2517+
2518+ # help: benchmark-rate-limiter-capacity-python - Capacity test with Python fallback (forced)
2519+ .PHONY : benchmark-rate-limiter-capacity-python
2520+ benchmark-rate-limiter-capacity-python : # # Capacity test with Python fallback
2521+ RATE_LIMITER_FORCE_PYTHON=1 $(MAKE ) benchmark-rate-limiter-redis-capacity
2522+
24782523.PHONY : benchmark-mcp-mixed-300
24792524benchmark-mcp-mixed-300 : # # Distributed 300-user mixed MCP benchmark
24802525 @echo " 📊 Running distributed mixed MCP benchmark..."
0 commit comments