[erlang-questions] confusing returns from httpc:request/4

Dan Kelley djk121@REDACTED
Sat Oct 9 17:25:38 CEST 2010


On Thu, Oct 7, 2010 at 2:00 PM, Anthony Molinaro <
anthonym@REDACTED> wrote:

> Hi Dan,
>
>   A quick websearch turned up
>
>
> http://stackoverflow.com/questions/2126630/erlangs-maximum-number-of-simultaneous-open-ports
>
> which seems to suggest you might be at the maximum allowable open file
> descriptors and need to update it.
>

Yeah, I had found that same thing.  I did some testing with lsof (I'm on
linux), and could never see the number of open filehandles go over ~200, and
my ulimit is set to 1024.

>
> I've had less than stellar results with httpc (see old posts on this group
>
> http://groups.google.com/group/erlang-programming/browse_thread/thread/1d94595c83b21ef6/1b2416a346b65596?lnk=gst&q=httpc#1b2416a346b65596
>
> http://groups.google.com/group/erlang-programming/browse_thread/thread/2f3684d1433c465d/2866bae1935138a2?lnk=gst&q=httpc#2866bae1935138a2
> ).
>
> I would highly recommend ibrowse though, it's worked really well.
>

.. and this turned out to be the answer for me too.  Based on your advice, I
switched to ibrowse, which has worked great.  Thanks!

Dan


>
> -Anthony
>
> On Thu, Oct 07, 2010 at 11:51:48AM -0400, Dan Kelley wrote:
> > Hi,
> >
> > I've got a simple router that's talking to a remote HTTP load balancer
> via
> > httpc:request/4.  For every request that I get into the router, I spawn a
> > new process then attempt to connect to the HTTP LB.
> >
> > That works well most of the time, but occasionally I get
> > {error, socket_closed_remotely} instead of results.  I had assumed that
> > these corresponded to the HTTP LB prematurely closing the connection, but
> > when I look at the logs for that process, it always thinks that it's
> > returning clean responses (HTTP 200 code, appropriately-formed bodies,
> etc).
> >
> > Anyone seen anything like this before?  What else might I do to debug
> this?
> >
> > Thanks,
> >
> > Dan
>
> --
> ------------------------------------------------------------------------
> Anthony Molinaro                           <anthonym@REDACTED>
>


More information about the erlang-questions mailing list