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

Improve performance of NetHttpRequest timeouts by reusing threads #1375

Open
scwhittle opened this issue May 14, 2021 · 0 comments · May be fixed by #1494
Open

Improve performance of NetHttpRequest timeouts by reusing threads #1375

scwhittle opened this issue May 14, 2021 · 0 comments · May be fixed by #1494
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.

Comments

@scwhittle
Copy link

If a timeout is specified for NetHttpRequest, a singlethreadedexecutor is created.
https://github.com/googleapis/google-http-java-client/blob/master/google-http-client/src/main/java/com/google/api/client/http/javanet/NetHttpRequest.java#L184

This creates a new thread for every request which showed up as a 30% cpu increase issuing requests when writing to BigQuery from a Cloud Dataflow pipeline.

It seems that this cost could be reduced by using a cachedThreadPool, or by allowing the caller to inject an executorService to be used.

@danoscarmike danoscarmike added the type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design. label May 14, 2021
dzikoysk added a commit to dzikoysk-playground/google-http-java-client that referenced this issue Nov 1, 2021
…s by providing a possibility to use custom threadpool (Fix googleapis#1375)
dzikoysk added a commit to dzikoysk-playground/google-http-java-client that referenced this issue Dec 9, 2021
dzikoysk added a commit to dzikoysk-playground/google-http-java-client that referenced this issue Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: feature request ‘Nice-to-have’ improvement, new feature or different behavior or design.
Projects
None yet
2 participants