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
The benchmark in mirage/ocaml-cohttp#328 seems unrealistic to me since the request handler responds immediately. Usually, some database requests are performed to build the response. So, I have investigated what happens when a Lwt.yield is added inside the request handler.
I'm using the following command to perform the benchmark. Compared to mirage/ocaml-cohttp#328, I had to significantly raise the request rate to overwhelm the web servers.
Cohttp is significantly slower than http/af, as expected. But http/af seems to exhibit some queueing as well, with a median latency of almost 10 seconds.
So, I'm wondering whether I'm doing anything wrong. Or maybe this is just something one should expect, since there is no longer any backpressure to limit the number of concurrent requests being processed?
The text was updated successfully, but these errors were encountered:
* cohttp_lwt_unix: make benchmark more realistic
This change is based on inhabitedtype/httpaf#200
in which @vouillon reasonably points out that it is unrealistic to assume that the request handler responds immediately.
The benchmark is modified to yield inside the request handler in order to simulate the effect of an hypotetical db request.
Signed-off-by: Marcello Seri <[email protected]>
* Add yield in the handler of the lwt examples
Signed-off-by: Marcello Seri <[email protected]>
* Add yield in the nethttp-go example
The function is documented here: https://golang.org/pkg/runtime/#Gosched
Signed-off-by: Marcello Seri <[email protected]>
* effects_benchmark: reindent and comment out unused code
mainly to reduce a number of warnings in the build
Signed-off-by: Marcello Seri <[email protected]>
The benchmark in mirage/ocaml-cohttp#328 seems unrealistic to me since the request handler responds immediately. Usually, some database requests are performed to build the response. So, I have investigated what happens when a
Lwt.yield
is added inside the request handler.The code is here: https://gist.github.com/vouillon/5002fd0a8c33eb0634fb08de6741cec0
I'm using the following command to perform the benchmark. Compared to mirage/ocaml-cohttp#328, I had to significantly raise the request rate to overwhelm the web servers.
Cohttp is significantly slower than http/af, as expected. But http/af seems to exhibit some queueing as well, with a median latency of almost 10 seconds.
So, I'm wondering whether I'm doing anything wrong. Or maybe this is just something one should expect, since there is no longer any backpressure to limit the number of concurrent requests being processed?
The text was updated successfully, but these errors were encountered: