You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jmeter.apache.org by sebb <se...@gmail.com> on 2014/02/26 03:21:36 UTC

Idle connection timeout where Keep-Alive is not sent

HC4 allows one to provide a ConnectionKeepAliveStrategy which allows
one to provide a time-to-live (TTL) for the connection, based on the
HttpResponse and the HttpContext

There is a default implementation which uses the Keep-Alive header to
calculate the time.

So we can subclass that, and provide our own calculation if the
default one does not find the header.

That's easy, and I've tried it.

What is not so obvious is how to specify which URLs need what idle timeouts.
The simplest would be to use a property to apply a timeout to any
requests that don't return the Keep-Alive header, but that may be too
crude in general, as it would enforce timeouts on every host.

However it would be a good proof of concept that could be used against S3 etc.

We could add an idle timeout field to the HttpSampler GUIbut that
might be tedious to maintain. Adding it to the Http Defaults would
work provided that there was a single value that suited all the Http
requests in scope (not much better than using a global property).

Would that be sufficient?
Or do we need a way to specify the timeout on a per-host basis?
Maybe a list of hostnames and timeouts?

Any other bright ideas?

I propose to implement the single property method (but document it as
subject to change) so that it can be tested in earnest.

Then we can see how it might need to be extended.

Re: Idle connection timeout where Keep-Alive is not sent

Posted by sebb <se...@gmail.com>.
On 26 February 2014 07:31, Milamber <mi...@apache.org> wrote:
>
> Le 26/02/2014 02:21, sebb a ecrit :
>
>> HC4 allows one to provide a ConnectionKeepAliveStrategy which allows
>> one to provide a time-to-live (TTL) for the connection, based on the
>> HttpResponse and the HttpContext
>>
>> There is a default implementation which uses the Keep-Alive header to
>> calculate the time.
>>
>> So we can subclass that, and provide our own calculation if the
>> default one does not find the header.
>>
>> That's easy, and I've tried it.
>>
>> What is not so obvious is how to specify which URLs need what idle
>> timeouts.
>> The simplest would be to use a property to apply a timeout to any
>> requests that don't return the Keep-Alive header, but that may be too
>> crude in general, as it would enforce timeouts on every host.
>>
>> However it would be a good proof of concept that could be used against S3
>> etc.
>>
>> We could add an idle timeout field to the HttpSampler GUIbut that
>> might be tedious to maintain. Adding it to the Http Defaults would
>> work provided that there was a single value that suited all the Http
>> requests in scope (not much better than using a global property).
>>
>> Would that be sufficient?
>
>
> Yes seems sufficient in a first time (have a property or idle timeout field
> to the Http Defautls GUI).
>
>
>> Or do we need a way to specify the timeout on a per-host basis?
>> Maybe a list of hostnames and timeouts?
>>
>> Any other bright ideas?
>>
>> I propose to implement the single property method (but document it as
>> subject to change) so that it can be tested in earnest.
>
>
>
> +1.
>
> Thanks
>
> Milamber
>
>
>>
>> Then we can see how it might need to be extended.
>>

OK, the idle timeout code has been implemented - for httpclient4 only,
I don't think it's worth it for the HC3.1 or Java stacks.

Re: Idle connection timeout where Keep-Alive is not sent

Posted by Milamber <mi...@apache.org>.
Le 26/02/2014 02:21, sebb a ecrit :
> HC4 allows one to provide a ConnectionKeepAliveStrategy which allows
> one to provide a time-to-live (TTL) for the connection, based on the
> HttpResponse and the HttpContext
>
> There is a default implementation which uses the Keep-Alive header to
> calculate the time.
>
> So we can subclass that, and provide our own calculation if the
> default one does not find the header.
>
> That's easy, and I've tried it.
>
> What is not so obvious is how to specify which URLs need what idle timeouts.
> The simplest would be to use a property to apply a timeout to any
> requests that don't return the Keep-Alive header, but that may be too
> crude in general, as it would enforce timeouts on every host.
>
> However it would be a good proof of concept that could be used against S3 etc.
>
> We could add an idle timeout field to the HttpSampler GUIbut that
> might be tedious to maintain. Adding it to the Http Defaults would
> work provided that there was a single value that suited all the Http
> requests in scope (not much better than using a global property).
>
> Would that be sufficient?

Yes seems sufficient in a first time (have a property or idle timeout 
field to the Http Defautls GUI).

> Or do we need a way to specify the timeout on a per-host basis?
> Maybe a list of hostnames and timeouts?
>
> Any other bright ideas?
>
> I propose to implement the single property method (but document it as
> subject to change) so that it can be tested in earnest.


+1.

Thanks

Milamber

>
> Then we can see how it might need to be extended.
>