FAQ
Hi,

Does net/http package pool and reuse connections? In my clients, I see the
program hold http connections open to a server even when I have called
Response.Body.Close(). If there is no pool (I cannot find one) then maybe I
have a bug and I am not closing all.

--
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@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Search Discussions

  • Feng Shen at Feb 7, 2013 at 3:20 am
    Yes, net/http has pooling:

    http://code.google.com/p/go/source/browse/src/pkg/net/http/transport.go#520
    On Thursday, February 7, 2013 10:54:13 AM UTC+8, Boris wrote:

    Hi,

    Does net/http package pool and reuse connections? In my clients, I see the
    program hold http connections open to a server even when I have called
    Response.Body.Close(). If there is no pool (I cannot find one) then maybe I
    have a bug and I am not closing all.
    --
    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@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Constantin Teodorescu at Jul 12, 2013 at 12:02 pm

    On Thursday, February 7, 2013 5:20:17 AM UTC+2, Feng Shen wrote:
    Yes, net/http has pooling:

    Do you mean "http is appropriate for pooling" because it can reuse the
    http.Client ?
    Otherwise, how do I configure a "20 connection http" pool to CouchDB, for
    example?
    Did not find anything in docs like that!
    Teo



    http://code.google.com/p/go/source/browse/src/pkg/net/http/transport.go#520
    On Thursday, February 7, 2013 10:54:13 AM UTC+8, Boris wrote:

    Hi,

    Does net/http package pool and reuse connections? In my clients, I see
    the program hold http connections open to a server even when I have called
    Response.Body.Close(). If there is no pool (I cannot find one) then maybe I
    have a bug and I am not closing all.
    --
    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@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Patrick Mylund Nielsen at Feb 7, 2013 at 3:20 am
    It does indeed. See http.Transport and its methods:
    http://golang.org/pkg/net/http/#Transport

    On Thu, Feb 7, 2013 at 3:54 AM, Boris Solovyov wrote:

    Hi,

    Does net/http package pool and reuse connections? In my clients, I see the
    program hold http connections open to a server even when I have called
    Response.Body.Close(). If there is no pool (I cannot find one) then maybe I
    have a bug and I am not closing all.

    --
    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@googlegroups.com.
    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@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Boris Solovyov at Feb 7, 2013 at 3:27 am
    Thanks! This seems like major feature of net/http that users should know
    about, but is buried in obscure docs, "Transport can also cache connections
    for future re-use." Can package maintainers add short sentence like that to
    main net/http docs please?

    On Wed, Feb 6, 2013 at 10:20 PM, Patrick Mylund Nielsen wrote:

    It does indeed. See http.Transport and its methods:
    http://golang.org/pkg/net/http/#Transport

    On Thu, Feb 7, 2013 at 3:54 AM, Boris Solovyov wrote:

    Hi,

    Does net/http package pool and reuse connections? In my clients, I see
    the program hold http connections open to a server even when I have called
    Response.Body.Close(). If there is no pool (I cannot find one) then maybe I
    have a bug and I am not closing all.

    --
    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@googlegroups.com.
    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@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Constantin Teodorescu at Jul 12, 2013 at 11:46 am

    On Thursday, February 7, 2013 5:27:27 AM UTC+2, Boris wrote:
    Thanks! This seems like major feature of net/http that users should know
    about, but is buried in obscure docs, "Transport can also cache connections
    for future re-use."
    Hello Boris, did you succeed in writing a pool of HttpConnections working?
    I had the same problem, I needed a 10-15 connections to a CouchDB server
    and implemented it with rrpool but I'm wondering if it's the best sollution!
    Do you have another one?
    Best regards,
    Teo

    --
    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@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.
  • Fshen at Feb 7, 2013 at 4:51 am
    Yes. net/http do have pooling.

    http://code.google.com/p/go/source/browse/src/pkg/net/http/transport.go#520

    On Thursday, February 7, 2013 10:54:13 AM UTC+8, Boris wrote:

    Hi,

    Does net/http package pool and reuse connections? In my clients, I see the
    program hold http connections open to a server even when I have called
    Response.Body.Close(). If there is no pool (I cannot find one) then maybe I
    have a bug and I am not closing all.
    --
    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@googlegroups.com.
    For more options, visit https://groups.google.com/groups/opt_out.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-nuts @
categoriesgo
postedFeb 7, '13 at 2:54a
activeJul 12, '13 at 12:02p
posts7
users5
websitegolang.org

People

Translate

site design / logo © 2022 Grokbase