Open mitar opened 2 years ago
cc @neild
It seems it might not be the serveMsgCh
. I increased queue size to 800 to experiment and it was still slow. So being able to push into serveMsgCh
quickly might not be the issue. So probably it is being blocked on processing the message and waiting on msg.done
.
cc @dunglas, Not sure if you experienced this. I was trying to do something similar to Vulcain, and push embedded objects using HTTP push instead of embedding them into the main object, but observed increased latency of processing the main request is somewhat killing the point.
What version of Go are you using (
go version
)?Does this issue reproduce with the latest release?
Yes.
What operating system and processor architecture are you using (
go env
)?go env
OutputWhat did you do?
I am trying to push multiple requests using HTTP2.
What did you expect to see?
From reading
pusher.Push
documentation, my expectation was that pushing negligibly impacts time the main request is served, as all pushing happens in separate goroutines.What did you see instead?
I am observing that this is not the case. I made a simple test and pushing 100 requests with 10 KB large responses takes 8 ms on my local machine, pushing 100 requests with 1 MB large responses takes 35 ms. So this is just additional time added to the main request handling to call
pusher.Push
in a loop. Not how long it takes for the pushed responses themselves to be delivered. This is a surprising amount to me.From looking at the code, I think the issue is that
pusher.Push
waits until it can send astartPushRequest
message toserveMsgCh
and with many push requests this can block for non-trivial amount of time.I made a small example here. See README for instructions how to run it.