hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: SocketException: Connection reset / Invalid argument
Date Wed, 14 Mar 2007 17:25:54 GMT
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. 

'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)

Anyways, take it for what it is worth.

Oleg

> ---------------------------------------------------------------------
> 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


Mime
View raw message