Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-dev] Clarification on Request Timeouts

Hi,

On Wed, May 31, 2017 at 9:02 PM, Neha Munjal <neha.munjal3@xxxxxxxxx> wrote:
> We are using Jetty client jars (v 9.3.7.v20160115) to make synchronous
> HTTP/2 communication.
>
> The synchronous send API allows to provide a timeout for a request.

Providing a timeout is not only for the blocking API, but also for the
non-blocking APIs.

> Also, for HTTP/2 communication, 9.3.X opens 1 TCP connection that processes
> all the queued requests.
> Additionally, we have maxRequestsQueuedPerDestination that configures the
> maximum number of requests that can be queued per end point, after starting
> to reject them.
>
> ContentResponse response = jettyRequest.timeout(config.reqTimeoutMillis(),
> TimeUnit.MILLISECONDS).send();
>
>
> We have a Load Test scenario where in we have a high number of requests
> being processed in a synchronous manner,

Blocking code in a load test is typically a bad idea.

> with a high number of requests also
> queued up and we have a timeout specified for the request, as mentioned
> above. Would like to clarify if the queued up requests will timeout if the
> server is busy processing other requests and the timeout value elapsed for
> some of the queued up requests or is the timeout value actually used once
> the request-response conversation has started? Please confirm.

The timeout starts when the send() API is called, so in your case
requests may well timeout while they are queued.

Note that if you write a load test and you queue up on the client, you
are not load testing properly.

-- 
Simone Bordet
----
http://cometd.org
http://webtide.com
Developer advice, training, services and support
from the Jetty & CometD experts.


Back to the top