Hi Team, I am trying out the aerospike for our production use case and when i cam hitting the server the cpu usage is not going above 5% due to this latency is very low. Aerospike version - 7.0.0.10 Cluster - 3 node cluster (each 2 core / 8gb ram) Client - aerospike-client-jdk21:8.1.1
Client
@Configuration
public class Config {
private static final Host[] hosts = new Host[] {
new Host("host1", 3000),
new Host("host2", 3000),
new Host("host3", 3000)
};
@Bean
public AerospikeClient aerospikeClient() {
ClientPolicy clientPolicy = new ClientPolicy();
clientPolicy.connPoolsPerNode = 10; //tried increasing these nothing is working
clientPolicy.maxConnsPerNode = 300; //same here
return new AerospikeClient(clientPolicy, hosts);
}
}
@RestController
@RequestMapping("/aerospike")
@Slf4j
public class Controller {
@Autowired
private AerospikeClient aerospikeClient;
private List<String> list = new ArrayList<>();
private List<Long> readLatencies = new ArrayList<>();
@PostMapping
public void write(@RequestBody Payload payload) {
String primaryKey = String.valueOf(UUID.randomUUID());
try {
WritePolicy writePolicy = aerospikeClient.getWritePolicyDefault();
writePolicy.socketTimeout = 30000;
writePolicy.totalTimeout = 30000;
Key key = new Key("perf", "", primaryKey);
Bin bin = new Bin("data", payload.getPayload());
aerospikeClient.put(writePolicy, key, bin);
} catch (Exception e) {
log.error("Error while writing to aerospike: {}", primaryKey, e);
}
}
@GetMapping
public String read(@RequestParam String primaryKey) {
String data = null;
try {
Key key = new Key("perf", "", primaryKey);
Policy policy = new Policy(aerospikeClient.getReadPolicyDefault());
policy.socketTimeout = 30000;
policy.totalTimeout = 30000;
data = aerospikeClient.get(policy, key).bins.get("data").toString();
} catch (Exception e) {
log.error("Error while reading from aerospike: {}", primaryKey, e);
}
return data;
}
}
tried increasing the hits to check if there is any issue with client config but still the same looks i need to change configuration in both client and server.
currently having ~500TPS to ~800TPS from client
server configs