[prev in list] [next in list] [prev in thread] [next in thread]
List: httpclient-users
Subject: Re: SocketException: Connection reset / Invalid argument
From: Oleg Kalnichevski <olegk () apache ! org>
Date: 2007-03-14 18:57:37
Message-ID: 1173898657.4796.14.camel () okhost
[Download RAW message or body]
On Wed, 2007-03-14 at 18:43 +0000, sebb wrote:
> On 14/03/07, Oleg Kalnichevski <olegk@apache.org> wrote:
> > On Wed, 2007-03-14 at 16:47 +0000, sebb wrote:
> > > I've been running some stress tests on JMeter using HTTPClient and
> > > Java HTTP. [Mainly the idea is to try and find synch etc problems in
> > > JMeter.]
> > >
> > > Every so often, the HTTPClient test reports SocketExceptions - mostly
> > > Connection reset, but sometimes Invalid argument (about 15% of the
> > > errors).
> > >
> > > The percentage of Socket errors is quite low - 0.5% or less - however
> > > I don't see any errors at all with the Java implementation.
> > >
> > > This is running on a 4 CPU Alpha, Java 1.4.2, Apache httpd 150
> > > clients, JMeter 140 threads, single GET per thread, looped 1000 times.
> > >
> > > The same errors happen, but less frequently, with fewer JMeter threads.
> > >
> > > It's not a show-stopper, but I would be interested to know if there is
> > > a known cause for this difference in behaviour?
> > >
> > > Sample stack traces (" at " has been removed):
> > >
> > > java.net.SocketException: Connection reset
> > > java.net.SocketInputStream.read(SocketInputStream.java:168)
> > > java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
> > > java.io.BufferedInputStream.read(BufferedInputStream.java:201)
> > > org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
> > > org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
> > > org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
> > > org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1969)
> > > org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1727)
> > > org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1090)
> > > org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
> > > org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
> > > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
> > > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
> > >
> > > and
> > >
> > > java.net.SocketException: invalid argument
> > > java.net.SocketInputStream.socketRead0(Native Method)
> > > java.net.SocketInputStream.read(SocketInputStream.java:147)
> > > java.io.BufferedInputStream.fill(BufferedInputStream.java:183)
> > > java.io.BufferedInputStream.read(BufferedInputStream.java:201)
> > > org.apache.commons.httpclient.HttpParser.readRawLine(HttpParser.java:78)
> > > org.apache.commons.httpclient.HttpParser.readLine(HttpParser.java:106)
> > > org.apache.commons.httpclient.HttpConnection.readLine(HttpConnection.java:1116)
> > > org.apache.commons.httpclient.HttpMethodBase.readStatusLine(HttpMethodBase.java:1969)
> > > org.apache.commons.httpclient.HttpMethodBase.readResponse(HttpMethodBase.java:1727)
> > > org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1090)
> > > org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
> > > org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
> > > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
> > > org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:323)
> > >
> > > S///
> > >
> >
> > Sebastian,
> >
> > In both cases an exception was thrown while HttpClient was waiting for a
> > response status line, which seems to indicate a server side problem in
> > my opinion.
>
> There are a few errors logged by Apache, but not nearly as many as I
> would expect, though I guess I'd need to see when they occurred in
> relation to the client failures.
I do not really know at what level of verbosity Apache HTTPD logs such
errors. At any rate I/O exceptions thrown by HttpClient are not client
failures. They are merely a reaction to the server side problems.
>
> > 'Connection reset' usually means the connection was unexpectedly closed
> > by the peer. In your case the server appears to have dropped connection
> > on the unsuspecting HttpClient before sending back a response most
> > likely due to the high load.
> >
> > You are not seeing this kind of exceptions with Java HTTP connection
> > because the damn thing simply silently retries failed requests as it
> > sees fit (at least that was the case when I last worked with Java HTTP
> > connection, which admittedly was a long time ago)
>
> Does HTTPClient not retry?
>
Not per default, if a request have been submitted to the server
http://jakarta.apache.org/commons/httpclient/xref/org/apache/commons/httpclient/DefaultMethodRetryHandler.html#70
Oleg
> There seems to be some retry code, but I did not follow it through to
> see if it applied in this case.
>
> If so, maybe I could try increasing the retry count.
>
> S
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpclient-user-help@jakarta.apache.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic