-
Notifications
You must be signed in to change notification settings - Fork 23
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
Analyze options to use SdkHttpClient implementations #101
Comments
ProsUse the built-in HttpUrlConnection client to reduce instantiation timeThe AWS Java SDK 2.x includes a pluggable HTTP layer that allows customers to switch to different HTTP implementations. Three HTTP clients are supported out-of-the-box:
With the default configuration, Apache HTTP client and Netty HTTP client are used for synchronous clients and asynchronous clients respectively. They are powerful HTTP clients with more features. However, they come at the cost of higher instantiation time. On the other hand, the JDK built-in
Hence, it's recommended using Exclude unused SDK HTTP dependenciesThe SDK by default includes Apache HTTP client and Netty HTTP client dependencies. If startup time is important to your application and you do not need both implementations, it's recommended excluding unused SDK HTTP dependencies to minimize the deployment package size. Below is the sample Maven POM file for an application that only uses
ConsIncoveniences of using the built-in HttpUrlConnection clientAs the JDK built-in
|
Hi @ptirador , Thanks for your investigation! What do you mean by "deployment package"? In my opinion, we need to have support for both synchronous and asynchronous requests. If the we need the Apache + Netty dependencies for this, then so be it. There are many other things that you can't do with the How much of a difference is there in terms of instantiation time? And the other question -- are we using async requests for anything right now? What use cases would we have for this? My only concern is that, at the moment, we claim to support JDK11 (which is, of course indeed the case), and, whatever we decide will have to make sure this does not break out JDK 11 support. Which one is your advice and personal preference? |
Thanks @ptirador for raising this issue and making the initial research! How did you come to the conclusion using the built-in Honestly, if I had to pick one of the three options above - I'd go with If you are up for the task - we can create a |
Hi @carlspring @steve-todorov, The conclusions that I wrote are based on this article, which talks about these instantiation times but without providing any benchmarch example. We can create this JMS benchmark to test them. In my opinion, I will also go with Netty and async connections, specially because of the overall performance boost that it provides. Also, a few months ago we switched the NIO implementation to use AsynchronousFileChannel instead of FileChannel, so I think it could be the best way to go. |
Hi @ptirador , I believe you and @steve-todorov are right -- we should use Netty, since indeed we did switch to How much of an effort will this task be? |
Task Description
The
S3Factory
class manages the build of a new Amazon S3 instance, which right now it's using an Apache HTTP Client.As specified in this Pull Request discussion, this is locking in customers to the
ApacheHttpClient
, which adds a dependency they may not want. It's needed to provide an option for otherSdkHttpClient
implementations.The UrlConnectionHttpClient is fairly popular choice in Java-based Lambda functions as it has faster startup time, so less impact to cold starts.
Tasks
The following tasks will need to be carried out:
SdkHttpClient
implementationsTask Relationships
This task:
Useful Links
Help
The text was updated successfully, but these errors were encountered: