You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Angelo Di Placido <an...@talkshoe.com> on 2007/08/01 19:16:20 UTC

Timeout on a request

Is there a way to specify a timeout on a http sampler?  During load testing
I am seeing the majority of my page requests being serviced in less than 2
seconds.  Occasionally however a request takes much longer (several minutes
or worse no response ever received).  I would like to be able to put a limit
on how long jmeter waits for outstanding requests.  I found a post to this
emailing list in March 2004:

 

I found a working solution for my timeout-problem:
Java 1.4 has got a property 'sun.net.client.defaultReadTimeout'. This can be
set to a appropriate value and raises a 'java.io.IOExcetion: Stream closed'
instead of waiting infinitely. Just set this property in the jmeter.bat as a
java parameter by 'java -Dsun.net.client.defaultReadTimeout=1000 ...' for a
1 second timeout for example.

 

 

Is this the way I should proceed or is there another way to solve the
problem?

 

Angelo.


RE: Timeout on a request

Posted by Kathy Mitchell <KM...@coremetrics.com>.
I had the same problem.  This worked for me.

Add a Duration Assertion as a child of your http request.  There is a
'Duration in milliseconds' field available in this assertion.

Also I had to update the jmeter.properties file set the timeout to
match.  This value is also in milliseconds.
# set the socket timeout (or use the parameter http.socket.timeout)
httpclient.timeout=120000


Kathy Mitchell
kmitchell@coremetrics.com
682-223-5334 

-----Original Message-----
From: Angelo Di Placido [mailto:angelod@talkshoe.com] 
Sent: Wednesday, August 01, 2007 12:16 PM
To: 'JMeter Users List'
Subject: Timeout on a request

Is there a way to specify a timeout on a http sampler?  During load
testing
I am seeing the majority of my page requests being serviced in less than
2
seconds.  Occasionally however a request takes much longer (several
minutes
or worse no response ever received).  I would like to be able to put a
limit
on how long jmeter waits for outstanding requests.  I found a post to
this
emailing list in March 2004:

 

I found a working solution for my timeout-problem:
Java 1.4 has got a property 'sun.net.client.defaultReadTimeout'. This
can be
set to a appropriate value and raises a 'java.io.IOExcetion: Stream
closed'
instead of waiting infinitely. Just set this property in the jmeter.bat
as a
java parameter by 'java -Dsun.net.client.defaultReadTimeout=1000 ...'
for a
1 second timeout for example.

 

 

Is this the way I should proceed or is there another way to solve the
problem?

 

Angelo.


---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org