1) Is there an implementation of the aws sdk which uses asynchronous I/O instead of thread pools? I am working on a highly scalable web service and profiling shows that the CPU is wasting a lot of cycles managing network I/O to and from amazon.
2)The current client uses Apache Http Client, if I cannot find an asynch implementation I will fork my own version to implement it. I was thinking of using the Jetty Http Client. Is it bad form to mix Jetty and Apache libraries? Is there a better alternative?
1) Is there an implementation of the aws sdk which uses asynchronous I/O instead of thread pools?
Not that I know of, and I'd be surprised this to be difficult to find, if it would exist already.
2) The current client uses Apache Http Client, if I cannot find an asynch implementation I will fork my own version to implement it. [...] Is there a better alternative?
There is a better alternative indeed - the AWS SDK for Java currently uses the Http Client version 4.x (you linked to the legacy 3.1 version JavaDocs instead) from Apache HttpComponents, which conveniently provides a Async HttpClient as well:
Async HttpClient is a HTTP/1.1 compliant HTTP agent implementation based on HttpCore NIO and HttpClient components. It is a complementary module to Apache HttpClient intended for special cases where ability to handle a great number of concurrent connections is more important than performance in terms of a raw data throughput. [emphasis mine]
As emphasized, it should only be facilitated for respective uses cases, but (as per your comment) you are sending thousands of requests to AWs which means that open requests tend to pile up, so this might help indeed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With