aerospike / aerospike-client-java

Aerospike Java Client Library
Other
236 stars 212 forks source link

Multiple Async Client share with Same SelectorManagers #71

Closed shanling2004 closed 7 years ago

shanling2004 commented 7 years ago

We have requirement to access multiple aerospike cluster with Async Client. While we want to reuse one selector thread to handle multiple cluster's access, it requires Multiple Async Client share with Same SelectorManagers

BrianNichols commented 7 years ago

Each AsyncClient instance currently contains it's own set of selector threads. The selector threads can't currently be shared. We may revisit this design limitation in a future release.

shanling2004 commented 7 years ago

Thanks @BrianNichols . The reason we propose this enhancement is because we will have multiple aerospike cluster underneath, we plan to enable async client with less IO selector thread to dispatch non-blocking requests in order to avoid unnecessary context switch or threading overhead.

However, currently IO selector thread number = policy.asyncSelectorThreads * <# of aerospike clusters> Selectormanager

shanling2004 commented 7 years ago

Not sure we have timeline for shared selector thread support cross multiple clusters?

BrianNichols commented 7 years ago

There is no timeline right now. We are looking into improving async java client performance and this change would be part of that task.

shanling2004 commented 7 years ago

Thanks @BrianNichols . Looking forward for async client roadmap. Let's keep in touch :)

BrianNichols commented 7 years ago

Java client 4.0.0 has been released:

http://www.aerospike.com/download/client/java/4.0.0/

This version allows you to specify Netty or direct NIO event loops independently and share them with multiple AerospikeClient instances. The new async methods in AerospikeClient add the target event loop as an argument. These methods are intended as a replacement for the old AsyncClient.

shanling2004 commented 7 years ago

Awesome @BrianNichols , we plan to integrate with async client 4.0.0 and give you the feedback.