You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE] Add k6 WebSocket performance tests for rate limiter #469
Is your feature request related to a problem? Please describe.
Currently there is no way to performance test the rate limiter under real concurrent load. Unit and integration tests verify logic and correctness but cannot simulate thousands of simultaneous WebSocket connections hitting the relay at the same time. This makes it hard to verify, whether the rate limiter i.e. EWMA or sliding window, work appropriately under high traffics.
Describe the solution you'd like
Set up k6 with WebSocket support (xk6-websockets or the built-in k6 WebSocket API) to simulate concurrent virtual users connecting to the relay and sending events. The test script should:
Spin up configurable number of virtual users simultaneously.
Each user opens a WebSocket connection and sends Nostr events.
Collect metrics i.e. accepted requests, rate limited rejections, response times.
Verify rate limiter correctly enforces limits under concurrent load.
Support testing both ewma and sliding_window strategies
Additional context
This is particularly useful for validating the EWMA rate limiter implementation introduced in issue #404 under realistic high-traffic conditions that integration tests cannot simulate efficiently.
Activity
cameri commentedon May 1, 2026
thank you!