mhjort / trombi

Load testing library for testing stateful apps with Clojure
Eclipse Public License 1.0
235 stars 19 forks source link

Add support for rate-based simulations #77

Closed dancmeyers closed 2 years ago

dancmeyers commented 2 years ago

Rate-based simulations run by creating a number of requests per second, regardless of the state of existing requests, rather than maintaining a number of concurrent requests.

Currently, it seems to be possible for rate based simulations to 'lock up' if too many requests block for too long. I think what is happening is that all the threads created by pipeline/prun are blocked waiting for a response, so no new requests are made until they return. I'm not 100% sure why this is happening. We pass in users equal to rate * timeout, so by the time we run out of 'free' threads the oldest one should have timed out and be ready to issue a new request. We are using core.async, but the lib still expects each step to synchronously return a boolean before either deciding to run the next step or a new instance of the scenario.

Testing against https://www.google.com/ at 100 reqs/sec for 30s showed some requests taking 11+ secs, even with a timeout of 5s. Is there some additional timeout we're hitting that isn't covered by :timeout in http-kit and defaults to much higher?

mhjort commented 2 years ago

@dancmeyers I found that you already closed the PR. Rate-based simulations could be very usable feature. I can try to help you if this is something you want to still work on? This is a big feature though, so it might take me some time...

dancmeyers commented 2 years ago

@mhjort I think I’ve got it working, PR hopefully incoming in the next few days. I closed this one because I meant to open it against my fork, get it checked by some folks in my org/run some tests with our API, then raise the PR here :)