Dynamically change parameters
Overview
You can use asadm or asinfo - set-config to set various parameters while Aerospike Database is running. Be aware that these are transient changes and will go away upon restart. Modify your configuration file if you want the changes to persist across restarts.
Use asadm to write parameters dynamically
Note: Tools package 6.0.x or later is required to use asadm’s manage config commands.
Set a value dynamically:
asadm -h [host ip] -p [port] -e "enable; manage config <context> [<context-label>] [<sub-context> [<sub-context-label>] [...]] param <parameter> to <value>"
Change a variable on the service
stanza:
$ asadm -e "enable; manage config service param proto-fd-max to 90000"
Change a variable on the network.heartbeat
stanza:
$ asadm -e "enable; manage config network heartbeat param interval to 100"
Change the high-water-memory-pct
variable on the namespace test
:
$ asadm -e "enable; manage config namespace test param high-water-memory-pct to 50"
Set a value dynamically:
asinfo -h [host ip] -p [port] -v [set-config command string]
Change a variable on the service
stanza:
$ asinfo -v "set-config:context=service;proto-fd-max=50000"
Change a variable on the network.heartbeat
stanza:
$ asinfo -v "set-config:context=network;heartbeat.interval=10"
Change the high-water-memory-pct
variable on the namespace test
:
$ asinfo -v "set-config:context=namespace;id=test;high-water-memory-pct=50"
Set common parameter settings
Increase the memory setting of a namespace
Aerospike memory can be increased and decreased dynamically, but it cannot be decreased to less than half the current value.
manage config namespace <NAMESPACE> param memory-size to 3G
or
manage config namespace <NAMESPACE> param memory-size to 3221225472
set-config:context=namespace;id=<NAMESPACE>;memory-size=3G;
or
set-config:context=namespace;id=<NAMESPACE>;memory-size=3221225472;
Slow down nsup/evictor/expirer
Set the number of seconds after which the nsup thread will wake up, evict, and expire objects.
manage config service param nsup-period to 3600
set-config:context=service;nsup-period=3600;
Slow down secondary index garbage collector
Set the number of seconds after which the secondary index garbage collector (sindex gc
) thread will wake up and garbage-collect.
manage config service param sindex-gc-period to 3600
Set the maximum number of secondary index entries that sindex gc
processes every second.
manage config service param sindex-gc-max-rate to 100000
Set the number of seconds the secondary index garbage collector (sindex gc
) thread will wake up and garbage collect.
set-config:context=service;sindex-gc-period=3600;
Set the maximum number of secondary index entries that sindex gc
processes every second.
set-config:context=service;sindex-gc-max-rate=100000;
Enable microbenchmarks
To investigate complex issues or slow transactions, you can enable microbenchmarks and storage-microbenchmarks, which print additional histograms in the logs.
See Histograms from Aerospike Logs for more details.
Alter the speed of migrations
Tweak global migration parameters:
Tune the defragmentation process
See the knowledge base article on Defragmentation
Change the logging level for a particular component
You can change the logging threshold of any component according to the syntax in these examples. For allowed levels, see the SEVERITY LEVELS section of the Log Reference.
manage config logging file <log-file> param migrate to debugmanage config logging file <log-file> param nsup to debugmanage config logging file <log-file> param rw to debug
log-set:id=0;migrate=debug;log-set:id=0;nsup=debug;log-set:id=0;rw=debug
You can view all available logging parameters by using asinfo -v log/0
The resultant output shows the logging component and the present value for that component.
$ asinfo -v log/0requested value log/0value is misc:CRITICAL;alloc:CRITICAL;...
Change the high-water-mark for memory
Change the high watermark for memory or disk. If the used memory/disk percent increases this value, the objects will be evicted from the database.
manage config namespace usermap param high-water-memory-pct=45manage config namespace test param high-water-disk-pct=45
set-config:context=namespace;id=usermap;high-water-memory-pct=45set-config:context=namespace;id=test;high-water-disk-pct=45