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

Thanks Simone.

I agree that load test is not the correct scenario here. But the point I wanted to highlight was that we would have bulk number of requests being processed asynchronously by a client object, which also implies that some requests will be queued up, depending upon the bandwidth, latency and processing capacity. Additionally, we can have intermittent synchronous HTTP/2 requests which have a timeout configured to be processed by the same client object. In scenarios when server is busy processing the requests and we have some async requests already queued up, the sync requests would also queue up, and there is a possibility of those timing out while they are queued.

It looks like that we should have separate HttpClient objects for sync and async modes, to avoid requests timing out, or not configure a timeout for synchronous requests, but that beats the idea of expecting a response within a designated time as we cannot have sync requests running forever.

Thanks
Neha

On Wed, May 31, 2017 at 12:43 PM, Simone Bordet <sbordet@xxxxxxxxxxx> wrote:
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.
_______________________________________________
jetty-dev mailing list
jetty-dev@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.eclipse.org/mailman/listinfo/jetty-dev


Back to the top