Skip to main content
Loading

How to ..?

Dynamically change parameters/configuration

note

Tools package 6.0.x or later is required to use asadm's manage config commands.

You can use asadm or asinfo - set-config to set various parameters while server is running. Please be aware that these are transient changes and will go away on server restart. You should add the changes to your configuration file if you want the changes to persist across server restarts.

note

Most of our Client APIs support using the info commands natively by calling the appropriate API with the desired value string. You can find a list of value strings following the '-v' in the commands that follow.

Use asadm to Write Parameters Dynamically

Note: Tools package 6.0.x or later is required to use asadm's manage config commands.

To set a value dynamically with asadm:

asadm -h [host ip] -p [port] -e "enable; manage config <context> [<context-label>] [<sub-context> [<sub-context-label>] [...]] param <parameter> to <value>"

Here is an example on how to change a variable on the service stanza:

$ asadm -e "enable; manage config service param proto-fd-max to 90000"

Here is an example on how to change a variable on the network.heartbeat stanza:

$ asadm -e "enable; manage config network heartbeat param interval to 100"

Here is an example on how to change a variable “high-water-memory-pct” on the namespace “test”:

$ asadm -e "enable; manage config namespace test param high-water-memory-pct to 50"

Use asinfo to Write Parameters Dynamically

To set a value dynamically with asinfo:

asinfo -h [host ip] -p [port] -v [set-config command string]

Here is an example on how to change a variable on the service stanza:

$ asinfo -v "set-config:context=service;proto-fd-max=50000"

Here is an example on how to change a variable on the network.heartbeat stanza:

$ asinfo -v "set-config:context=network;heartbeat.interval=10"

Here is an example on how to change a variable “high-water-memory-pct” on the namespace “test”:

$ asinfo -v "set-config:context=namespace;id=test;high-water-memory-pct=50"

Set common parameter settings

caution

The examples below are meant to illustrate dynamic configuration changes using asinfo. You should not use the commands below without understanding the requirement. A wrong setting value could further aggravate a minor problem in a running cluster.

Increase the memory setting of a namespace.

Aerospike memory can be increased/decreased dynamically, but it cannot be decreased to less than half the current value.

asadm:

manage config namespace <NAMESPACE> param memory-size to 3G

or

manage config namespace <NAMESPACE> param memory-size to 3221225472

asinfo:

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.

asadm:

manage config service param nsup-period to 3600

asinfo:

set-config:context=service;nsup-period=3600;

Slow down secondary index garbage collector

Set the number of seconds the sindex gc thread will wake up and garbage collect.

asadm:

manage config service param sindex-gc-period to 3600

asinfo:

set-config:context=service;sindex-gc-period=3600;

Set maximum number of secondary index entries sindex gc processes every second.

asadm:

manage config service param sindex-gc-max-rate to 100000

asinfo:

set-config:context=service;sindex-gc-max-rate=100000;

Switch on microbenchmark

In order to investigate complex issues/slow transactions, sometimes it’s helpful to enable microbenchmarks and storage-microbenchmarks , which will print additional histograms in the logs.

See Histograms from Aerospike Logs for more details.

Alter the speed of migrations

Tweak global migration parameters:

See Tuning Migrations

Tune the Defragmentation process

See Knowledge-Base on Defragmentation

Change the logging level for a particular component

Change the logging threshold of any component. The syntax below should be followed. For allowed levels, see the SEVERITY LEVELS section of the Log Reference.

asadm:

manage config logging file <log-file> param migrate to debug
manage config logging file <log-file> param nsup to debug
manage config logging file <log-file> param rw to debug

asinfo:

log-set:id=0;migrate=debug;
log-set:id=0;nsup=debug;
log-set:id=0;rw=debug

You can find all the 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/0
requested value log/0
value is misc:CRITICAL;alloc:CRITICAL;...

For more on this, please check the asinfo docs.

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.

asadm:

manage config namespace usermap param high-water-memory-pct=45
manage config namespace test param high-water-disk-pct=45

asinfo:

set-config:context=namespace;id=usermap;high-water-memory-pct=45
set-config:context=namespace;id=test;high-water-disk-pct=45