[erlang-questions] inets HTTP client does not persist connections when POSTing
Mon Aug 4 16:18:54 CEST 2008
Thanks, Ingela, I look forward to seeing the modifications. Hopefully you
can post a patch so I don't have to wait for the next Erlang release.
On Mon, Aug 4, 2008 at 4:47 AM, Ingela Anderton Andin <
> Hi Edward, a quick look at the HTTP-spec makes me believe you got a
> valid point.
> The current http client has gradually evolved from a user contribution
> and in the processes
> you may say it was totally rewritten, and we may have missed an aspect
> here. (E.i. only used
> persistent connections for pipelined requests). But I do not
> have all details about this fresh in my memory as this was some time
> ago. We will have to take
> deeper look into this. I have put it on the todo-list. There are a few
> things that has
> higer priority right now but i hope we can deal with this issue fairly
> Regards Ingela- Erlang/OTP, Ericsson
> > I am using the inets HTTP client to POST many requests to the same URL. I
> > finding that even though keep-alive is set, and persistent connections
> > the default for HTTP 1.1 (which is what I am using), the inets HTTP
> > is opening a new connection for every http:request(post,...) I send. I
> > verified this by using Wireshark to monitor the TCP/IP traffic. When
> > is a lot of activity involving multiple clients, this causes ephemeral
> > exhaustion because of the infamous TIME_WAIT problem. I have already
> > the TCP wait time to 30 seconds and don't want to reduce it more.
> > I read the inets code, and if I understand it correctly, it seems that
> > a non-idempotent operation such as POST is performed, httpc does not
> > the existing connection (httpc_manager:select_session/4 returns
> > no_connection, which starts a new handler). I am not sure if this is the
> > correct thing to do, because my understanding is that the restriction on
> > non-idempotent operations applies to pipelining, not persistent
> > I can see no reason why one should not be able to do a series of
> > POSTs on the same socket, as long as one waits for a reply before posting
> > the next request.
> > I'm not sure if this is a bug, a feature, or my misunderstanding, so I am
> > posting to this mailing list in the hope that someone, whose name may or
> > not be Ingela, can enlighten me and perhaps suggest how I can use inets
> > do multiple sequential POSTs on a persistent connection.
> > I'm using OTP R12B-3 on Ubuntu Linux 8.04. The http:request call uses all
> > default HTTP and TCP/IP options (i.e. empty lists).
> > Regards,
> > Edwin Fine
> erlang-questions mailing list
For every expert there is an equal and opposite expert - Arthur C. Clarke
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the erlang-questions