# Dynamically change parameters

## Overview

::: note
[Tools package 6.0.x](https://aerospike.com/docs/database/tools/release-notes#tools-603) or later is required to use asadm’s [manage config](https://aerospike.com/docs/database/tools/asadm/live-mode/#manage) commands.
:::

You can use [asadm](https://aerospike.com/docs/database/tools/asadm/live-mode/#manage) or [asinfo - set-config](https://aerospike.com/docs/database/reference/info#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.

::: 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](https://aerospike.com/docs/database/tools/release-notes#tools-603) or later is required to use asadm’s [manage config](https://aerospike.com/docs/database/tools/asadm/live-mode/#manage) commands.

-   [asadm](#tab-panel-1100)
-   [asinfo](#tab-panel-1101)

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

::: 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 and decreased dynamically, but it cannot be decreased to less than half the current value.

-   [asadm](#tab-panel-1102)
-   [asinfo](#tab-panel-1103)

`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.

-   [asadm](#tab-panel-1104)
-   [asinfo](#tab-panel-1105)

`manage config service param nsup-period to 3600`

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

## Slow down secondary index garbage collector

-   [asadm](#tab-panel-1106)
-   [asinfo](#tab-panel-1107)

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](https://aerospike.com/docs/database/observe/latency) for more details.

## Alter the speed of migrations

Tweak global migration parameters:

See [Tuning Migrations](https://aerospike.com/docs/database/8.0.0/manage/cluster/migrations)

## Tune the defragmentation process

See the knowledge base article on [Defragmentation](https://support.aerospike.com/s/article/How-does-Defragmentation-work-in-Aerospike)

## 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](https://aerospike.com/docs/database/reference/logs).

-   [asadm](#tab-panel-1108)
-   [asinfo](#tab-panel-1109)

```plaintext
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
```

```plaintext
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.

```plaintext
$ asinfo -v log/0

requested value  log/0

value 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](https://aerospike.com/docs/database/8.0.0/manage/namespace/retention) from the database.

-   [asadm](#tab-panel-1110)
-   [asinfo](#tab-panel-1111)

```plaintext
manage config namespace usermap param high-water-memory-pct=45

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

```plaintext
set-config:context=namespace;id=usermap;high-water-memory-pct=45

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