Redis cache limit
Redis cache limit fault limits the amount of memory used by a Redis cache. The original limit is restored after the chaos duration.
Use cases
Determines the resilience of Redis-dependant applications on frequent cache misses that occur due to a low cache size.
- This fault can be executed on Ubuntu 16 or higher, Debian 10 or higher, CentOS 7 or higher, RHEL 7 or higher, Fedora 30 or higher, and openSUSE LEAP 15.4 or higher.
- The
linux-chaos-infrastructure
systemd service should be in an active state, and the infrastructure should be inCONNECTED
state.
Fault permissions
The fault uses the root
Linux user and root
user group.
Redis authentication
The following authentication and connection details reside on the same machine where the chaos infrastructure is executed. These details are provided in the /etc/linux-chaos-infrastructure/redis.env
file in the following format:
ADDRESS="127.0.0.1:6379"
PASSWORD=XXXXXXXX
TLS_AUTH_CERT="/path/to/tls-cert"
ADDRESS
is a mandatory field. You can also include PASSWORD
and TLS_AUTH_CERT
fields. You need them only if you have configured your Redis database to facilitate authentication.
ENV name | Description | Example |
---|---|---|
ADDRESS | Location where the Redis server is running. | redis-server.com |
PASSWORD | Password to connect to the Redis database. | password |
TLS_AUTH_CERT | File path to the location where the TLS certificate is stored. | /path/to/file |
Optional tunables
Tunable | Description | Notes |
---|---|---|
maxMemory | The percentage of existing Redis maxMemory or an absolute amount (in MB, KB, GB) that should be used by Redis. | Default: 50 %. For more information, go to maximum memory. |
duration | Duration through which chaos is injected into the target resource. Should be provided in [numeric-hours]h[numeric-minutes]m[numeric-seconds]s format. | Default: 30s . Examples: 1m25s , 1h3m2s , 1h3s . For more information, go to duration. |
rampTime | Period to wait before and after injecting chaos. Should be provided in [numeric-hours]h[numeric-minutes]m[numeric-seconds]s format. | Default: 0s . Examples: 1m25s , 1h3m2s , 1h3s . For more information, go to ramp time. |
Maximum memory
The maxMemory
input variable indicates the percentage of Redis cache memory or absolute memory used by Redis to limit during the chaos duration. Its default value is 50 %.
The following YAML snippet illustrates the use of this input variable:
apiVersion: litmuchaos.io/v1alpha1
kind: LinuxFault
metadata:
name: redis-cache-limit
labels:
name: cache-limit
spec:
redisChaos/inputs:
duration: "30s"
maxMemory: "50%"
rampTime: ""