We are facing high connections issue on a node. During debug, we suspect its due to hot keys on the box while doing batch read. We plan to increase RF & use Replica.MASTER_PROLES policy for the batch read.
public Record[] batchGet(Key[] keys) {
BatchPolicy batchPolicy = new BatchPolicy();
batchPolicy.replica = Replica.MASTER_PROLES;
batchPolicy.maxConcurrentThreads = 0;
return aerospikeClient.get(batchPolicy, keys);
}
Thanks for your reply. As you said, this is what we want ie to avoid batch read calls traffic going only to corresponding master copy node but to also distribute over replica nodes. Just when we started to code to use MASTER_PROLES, in comments section of the java client code, we found Batch calls are not affected by replica algorithms. Can you clarify if MASTER_PROLES will work for our batch read calls? Can we ignore this comment?
/**
Replica algorithm used to determine the target node for a single record command.
Batch, scan and query are not affected by replica algorithms.
Default: {@link Replica#SEQUENCE}
*/
public Replica replica = Replica.SEQUENCE;