Custom Parameters
a9s Redis® Custom Parameters
As mentioned in Using an a9s Data Service - Custom Parameters as an end user, an Application Developer has the opportunity to customize their Service Instance by using custom parameters.
Change RDB Persistence Settings
a9s Redis®* supports RDB persistence with point in time snapshots. This setting can be changed by the user.
Default Behavior
By default, persistency is disabled for a9s Redis® Service Instances. However, if a backup snapshot is created and
the instance is restarted by an update, the backup snapshot is restored, even if persistence is disabled.
This affects both single instances and clusters. Data created between the backup and the update is not persistent and
will be lost after the restart. Therefore, we recommend the following setup for cache-only instances with
disabled persistency: Use the exclude_from_auto_backup
option to avoid the creation of backups.
More information is available here.
Configuring RDB
You can configure RDB according to the needs of your apps by providing custom parameters as settings. This setting must
follow the original Redis® configuration for RDB -c "{\"snapshot\": \"['save 900 1','save 300 10']\"}
.
cf update-service my-redis-service -c "{\"snapshot\": \"['save 900 1','save 300 10']\"}"
In this example, it configures to snapshot the Redis® database according to the following rules:
Setting | Effect |
---|---|
save 900 1 | Create a snapshot after 900 seconds if 1 write operations occurred. |
save 300 10 | Create a snapshot after 300 seconds if 10 write operations occurred. |
Cache Only
You can disable snapshots and use Redis® as cache only by creating the service with the following custom parameter:
-c "{\"snapshot\": \"[]\"}"
.
The command is:
cf update-service my-redis-service -c "{\"snapshot\": \"[]\"}"
For more information, see the snapshot settings in the documentation of Redis® Persistence.
Change Maxmemory Policy
With the maxmemory_policy
, you can configure a9s Redis® which key to
remove when maxmemory
is reached. There are several configurable behaviors.
Setting | Effect |
---|---|
volatile-lru | Remove the key with an expire set using an LRU algorithm This is the default value. |
allkeys-lru | Remove any key according to the LRU algorithm |
volatile-random | Remove a random key with an expire set |
allkeys-random | Remove a random key |
volatile-ttl | Remove the key with the nearest expire time (minor TTL) |
noeviction | Don't expire at all, just return an error on write operations |
You can use -c {"maxmemory-policy": "volatile-ttl"}
to update the maxmemory-policy.
cf update-service my-redis-service -c {"maxmemory-policy": "volatile-ttl"}
For more information, see the maxmemory_policy
settings in the self documented redis.conf.
lazyfree-lazy-eviction
The default value is no
.
The allowed values are yes
and no
.
lazyfree-lazy-expire
The default value is no
.
The allowed values are yes
and no
.
lua-time-limit
The default value is 5000
.
The value must be an integer
.
maxclients
The default value is 10000
.
The value must be an integer
> 0
.
maxmemory-policy
The default value is volatile-lru
The allowed string values are:
volatile-lru
volatile-lfu
volatile-random
volatile-ttl
allkeys-lru
allkeys-lfu
allkeys-random
noeviction
For an explanation, see here.
maxmemory-samples
The default value is 5
.
The value must be an integer
>= 0
.
notify-keyspace-events
This parameter allows to configure the Redis® Keyspace Notifications.
The default value is ''
which means by default keyspace events are disabled.
failover-timeout
It is a Redis® sentinel property that specifies the failover timeout in milliseconds. The default is 30 seconds.
The default value is 30000
.
The value must be an integer
>= 0
.
down-after-milliseconds
It is a Redis® sentinel property that specifies the milliseconds a node is unreacheable in order to consider it subjectively down. The default is 10 seconds.
The default value is 10000
.
The value must be an integer
>= 0
.
tls-protocols
Only available with SSL/TLS plans that are available with a9s Redis® 6 and above.
You can explicitly specify TLS versions to support. Allowed values are "TLSv1.2" and "TLSv1.3" or any combination.
- Improper changes to this value can easily break existing instances.
- When using TLSv1.3 only, Redis® specific metrics will not be provided.
The default value is null
.
In this case Redis® uses TLSv1.2 and TLSv1.3.
tls-ciphers
Only available with SSL/TLS plans that are available with a9s Redis® 6 and above. This configuration only applies when using TLSv1.2.
Configure allowed ciphers. See the ciphers(1ssl) manpage for more information about the syntax of this string.
There is no validation enabled for the user provided values and therefore existing instances can break when applying this parameter.
The default value is null
which comments out the Redis® config tls-ciphers
in the Redis® and Sentinel configuration files.
tls-ciphersuites
Only available with SSL/TLS plans that are available with a9s Redis® 6 and above. This configuration only applies when using TLSv1.3.
Configure allowed ciphersuites. See the ciphers(1ssl) manpage for more information about the syntax of this string, and specifically for TLSv1.3 ciphersuites.
There is no validation enabled for the user provided values and therefore existing instances can break when applying this parameter.
The default value is null
which comments out the Redis® config
tls-ciphersuites
in the Redis® and Sentinel configuration files.
hostname-resolution
- This feature is exclusive to a9s Redis® versions 7 and above.
- This feature specifically applies to a9s Redis® Cluster instances.
- When enabling or disabling the feature in an existing a9s Service Instance, there might be an increased downtime during the first cluster update due to a temporary divergence in Sentinel's settings when switching between IP address and hostname.
- When enabled, unexpected delays in address resolution may have a negative impact on Sentinel. For more information, refer to the Redis® documentation.
The feature provides the option to enable and disable DNS/hostname support in Redis® and Sentinel. When enabled, it will utilize the hostname for internal cluster communication and announce Redis® and Sentinel node information using the hostname instead of the typical IP address.
Using this feature is useful when Redis® clients use TLS to connect to Service Instances and require a hostname rather than an IP address in order to perform certificate ASN matching.
Using it
To enable or disable hostname-resolution
, it is important to follow a series of steps to ensure safety and prevent
significant downtime or data loss. Depending on its current state, the process may require adjusting a custom parameter
in two steps. See the cases below:
- To enable it in an existing Service Instance, follow these steps:
disabled → resolve-only → enabled
. - To disable it in an existing Service Instance, follow these steps:
enabled → resolve-only → disabled
. - When you create a new Service Instance, you can set any value directly. We suggest using either
enabled
ordisabled
.
Please note that transitioning directly from disabled
to enabled
, and vice versa, is not possible in an existing
Service Instance.
States/Values | Description |
---|---|
disabled | Hostname resolution and announcement are fully disabled. |
resolve-only | Hostname resolution is enabled but announcement is disabled. |
enabled | Hostname resolution and announcement are fully enabled. |
The default value is disabled
.
*Redis is a registered trademark of Redis Ltd. Any rights therein are reserved to Redis Ltd. Any use by anynines GmbH is for referential purposes only and does not indicate any sponsorship, endorsement or affiliation between Redis and anynines GmbH.