How to check aerospike cluster is idle

How to find out if a Aerospike cluster is idle is there any conditions to check?, i tried to check the log files but even if the cluster is idle it los the health so can anyone please let me know how to check if aerospile cluster is idle or not being used at all.

There are many metrics that will help you check the activity in the cluster.

For instance, this command can tell you if the cluster is being used at this point for client connections and requests by looking at the differences in each snapshot: asadm -e "watch 3 5 show statistics " | grep -e rw_in_progress -e client_connections

1 Like

In addition to the key metrics and looking at number of connections, there are metrics that track total number of namespace reads/writes/udf transactions - I trust those a lot! If you have prometheus setup its easy to sum(increase(<namespace metric>[1d])) to see if anyone is using it

1 Like

Can I check from how many days it is being idle, i need to check if it’s not being used for 15 days, i need to generate an alert

Can I check from how many days it is being idle, i need to check if it’s not being used for 15 days, so that I can generate an alert

Depending on the type of transactions you expect, simply check those metrics as @Albot hinted and see if there is any increment. For example, if you expect read transactions, check all the client_* metrics (there are quite a few) and make sure they do not change over the time period you are interested in.

To be a bit more complete and cover most transactions, you can go by the statistics used in this log line:

{ns_name} client: tsvc (0,0) proxy (0,0,0) read (126,0,1,3,1) write (2886,0,23,2) delete (197,0,1,19,3) udf (35,0,1,4) lang (26,7,0,3)

If you expend that log reference entry, you can see all the statistics that it uses.

You would then have to check for scans / PI queries / SI queries / batches (you can get to those similarly from the relevant log line and the stats associated with them).

Finally, to be really complete (and I may still be missing some), the stats associated with the following log line would need to also not increment (in case all transactions are somehow failing early… very unlikely):

early-fail: demarshal 0 tsvc-client 1 tsvc-from-proxy 0 tsvc-batch-sub 0 tsvc-from-proxy-batch-sub 0 tsvc-udf-sub 0 tsvc-ops-sub 0

1 Like