Graham Miller
2013-06-18 21:29:01 UTC
I have a server that uses http.ListenAndServe() to handle http requests.
Recently we went through the exercise of adding fine(r) grained
synchronization to our back-end query engine to allow it to handle multiple
simultaneous requests. We then removed the global lock on our query
engine, and to our surprise, requests were still handled sequentially.
I think we have traced the problem to the fact that the browser (Chrome) is
pipelining multiple requests over the same TCP connection. Then what
appears to happen is that the HTTP package waits for the completion of the
first request's handler before it reads the next request off of the socket.
So my first question, is: does this sound right, can anyone confirm?
Secondly, assuming that this is the case, is there any way to work around
this behavior, and process the two requests in parallel? Or alternatively,
to force Chrome into sending requests over separate TCP connections?
Thanks.
graham
Recently we went through the exercise of adding fine(r) grained
synchronization to our back-end query engine to allow it to handle multiple
simultaneous requests. We then removed the global lock on our query
engine, and to our surprise, requests were still handled sequentially.
I think we have traced the problem to the fact that the browser (Chrome) is
pipelining multiple requests over the same TCP connection. Then what
appears to happen is that the HTTP package waits for the completion of the
first request's handler before it reads the next request off of the socket.
So my first question, is: does this sound right, can anyone confirm?
Secondly, assuming that this is the case, is there any way to work around
this behavior, and process the two requests in parallel? Or alternatively,
to force Chrome into sending requests over separate TCP connections?
Thanks.
graham
--
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
You received this message because you are subscribed to the Google Groups "golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.