Speed up Garbage Collection

The Aerospike Knowledge Base has moved to https://support.aerospike.com. Content on https://discuss.aerospike.com is being migrated to either https://support.aerospike.com or https://docs.aerospike.com. Maintenance on articles stored in this repository ceased on December 31st 2022 and this article may be stale. If you have any questions, please do not hesitate to raise a case via https://support.aerospike.com.

Synopsis:

When deletes in sindex (secondary index) takes longer then normal or is really slow to delete.

Path to resolution:

Depending on how the sindex was created. If your sindex was created by persisted and you want those settings to stay static. You will have to change it in the configuration.

namespace test {
   ...
   si ind1 {
       si-gc-period 1000          #Interval between two iterations of index garbage collection
	   si-gc-max-units 10000     #Maximum number of elements we walk in the index tree for garbage-collection in one cycle
	   si-tracing 0              #The value that indicates the level of global tracing for this index
	   si-histogram false        # Flag to enable si-historgram mapping of this index
   }
}

This works for both Dynamic and Static, you can run the following command to change the parameter values:

asinfo -v "set-config:context=namespace;id=<namespaceid>;indexname=<indexid>;<parameter value>"

gc-period : 500      : Lowering the value will make it wait less time between intervals
gc-max-units 500  : increasing the value will make it walk through less elements in a garbage collection cycle.

More info can be read upon here: http://www.aerospike.com/docs/operations/manage/indexes

Is there any way to know from server side if this needs to be tweaked?