simple-web-benchmark
simple-web-benchmark copied to clipboard
Rust/Rocket configuration doesn't use the default number of workers
The configuration had to be tweaked for benchmarking to work - the number of workers is hardcoded to 256. Other samples do not have it, and it gives the Rust/Rocket sample the unfair advantage.
With the default behaviour the test work, but takes too much time to finish. Here is the sample distribution:
0.000 [30485]
0.615 [16565]
1.231 [80]
1.846 [0]
2.462 [0]
3.077 [0]
3.693 [0]
4.308 [0]
4.924 [0]
5.539 [28]
6.154 [100]
A lot of responses take 615 ms to finish, and some of them even take 6154 ms. My guess is that Rocket tries to process all requests, got a big queue and become overloaded. Other samples just drop connections if can't process them. So it may be a misconfiguration issues, or a problem in Rocket framework.
Why did you set workers to 256?
I tried few combinations (8, 16) and all of them got stuck. Considering that hey uses 256 concurrent connections in the tests, I've decided to use 256 workers too - it would mean that each connection is handled by a separate worker, so none of them will stuck (I may be wrong, and internally it doesn't work this way though). I didn't have time to tweak it, or research the problem (hence the ticket exists), so just left it as is.