Raghu
Raghu

Reputation: 623

Aerospike Hot Key error

Based on this link, I understood that hotkey error happens when there are too many concurrent operation requests for the same key.

My current scenario:

I have a record which will get updated in every 5-10 seconds interval and I will have around 20 machines each with 10K Queries per second tries to read that record

Upvotes: 5

Views: 3003

Answers (2)

Mani Gandham
Mani Gandham

Reputation: 8312

Based on your question details, are you saying that you have 20 servers that each lookup the same record 10k times/sec?

We set the transaction-pending-limit to 0 to remove the limit on pending operations and were able to do roughly 30k operations/sec on the same key in-memory. If you want to have 200k ops/sec, you can use a cluster with more nodes and use read-from-replica settings to get the throughput.

If the record is only changing every 5-10 seconds though, then why not read the record once per second and cache the result within your application? Even if it's different keys, smart caching within your app will greatly reduce the operations and network traffic required and let your system scale much better. This is the best option.

Upvotes: 3

Meher
Meher

Reputation: 2939

1- Both reads/updates.

2- Per node. All transactions will go to node holding the master partition for that record for update and for read it will also go to node holding the master partition for that record, unless if you have a client policy to also read from node holding replica(s) partition.

3- Hard to give numbers. It will cause more client connections to the nodes where the hotkey is, which in turn can degrade performance, depending on the setup.

4- Easiest, if use case permits, would be to use the read replica client policy to mitigate the reads across master and replica partitions. Otherwise, create multiple keys.

Upvotes: 7

Related Questions