Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Huge delay in request processing when using AsyncHttpClient #1822

Open
swasti7 opened this issue Jul 31, 2022 · 0 comments
Open

Huge delay in request processing when using AsyncHttpClient #1822

swasti7 opened this issue Jul 31, 2022 · 0 comments

Comments

@swasti7
Copy link

swasti7 commented Jul 31, 2022

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);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant