Hi Jakub, Yes, that's what we're finally doing now, we're using separate http.Client for each microservice. And I can say that the performance improvement is quite significant. Based on your comment, can you maybe give me an insight on the relationship between http.Client and http.Transport? Can I assume that the performance increase is now due to each client have its own connection pool (from its http.Transport) dedicated to one host only?
On Thursday, September 7, 2017 at 6:48:05 AM UTC+7, Jakub Labath wrote: > > > My first instinct is to simply use one http.Client per each micro service. > > So when talking to microservice A - i would retrieve the client for > microservice A from somewhere. > The immediate gain is that it presumably already has tcp connection (or > several) open to the service A. > > It is also possible to overwrite the dial methods to hook in your own code > for tracing connections. To see when they are opened and closed. > > At work we wrote this to abstract and share setting as they might be > relevant to talking to each service. > > https://github.com/gadventures/httpclient > > Good luck > > Jakub > -- 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+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.