Skip to content

Huge delay in request processing when using AsyncHttpClient #1822

Open
@swasti7

Description

@swasti7

I created a simple HTTP request using the AHC client. I am seeing it is taking around 680ms for an endpoint which normally takes 50ms (verified by using curl) . What is the reason of such large response time with AHC client. Do i need to set something before using AHC client. Not sure what I am missing. Note that I am only sending single request a time.

import org.asynchttpclient.AsyncHttpClient;
import org.asynchttpclient.Response;
import static org.asynchttpclient.Dsl.asyncHttpClient;

AsyncHttpClient client = asyncHttpClient();

Long startTime = System.nanoTime();
Future<Response> responseFuture = asyncHttpClient.prepareGet(healthCheckRequest.getUriString()).execute();
Response res = responseFuture.get();
 Long endTime = HealthCheckUtils.getMillisSince(startTime);
 System.out.println("End time: " + endTime);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions