Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CHAOS-5571 Redis cache penetration #6814

Merged
merged 5 commits into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions docs/chaos-engineering/chaos-faults/linux/experiments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,4 +92,12 @@ export const experiments: ExperimentDetails[] = [
tags: ["linux","time"],
category: "linux",
},
{
name: "Redis cache penetration",
description:
"Redis cache penetration fault continuously sends cache requests to the Redis database to find the value for a non-existing key. This continuous request reduces the performance of the application.",
tags: ["linux"],
category: "linux",
},
];

16 changes: 16 additions & 0 deletions docs/chaos-engineering/chaos-faults/linux/linux.md
Original file line number Diff line number Diff line change
Expand Up @@ -247,3 +247,19 @@ Linux time chaos injects chaos to change the time of the Linux machine.
</Accordion>

</FaultDetailsCard>

<FaultDetailsCard category="linux">

### Redis cache penetration

Redis cache penetration fault continuously sends cache requests to the Redis database to find the value for a non-existing key. This continuous request reduces the performance of the application.

<Accordion color="green">
<summary>Use cases</summary>

- Slows down the database for responses to other requests.
- Determines the resilience of Redis-dependant application when cache requests are continuously sent to a Redis database and they result in a cache miss.

</Accordion>

</FaultDetailsCard>
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
---
id: redis-cache-penetration
title: Redis cache penetration
---

import Ossupport from './shared/note-supported-os.md'
import FaultPermissions from './shared/fault-permissions.md'
import AuthenticationDetails from './shared/redis-auth.md'

Redis cache penetration fault continuously sends cache requests to the Redis database to find the value for a non-existing key. This continuous request reduces the performance of the application.

![Redis cache penetration](./static/images/redis-cache-penetration.png)

## Use cases
- Slows down the database for responses to other requests.
- Determines the resilience of Redis-dependant application when cache requests are continuously sent to a Redis database and they result in a cache miss.

<Ossupport />

<FaultPermissions />

<AuthenticationDetails />

### Optional tunables

<table>
<tr>
<th> Tunable </th>
<th> Description </th>
<th> Notes </th>
</tr>
<tr>
<td> requestCount </td>
<td> Number of requests to be sent for accessing the cache. </td>
<td> Default: 1000. For more information, go to <a href="#number-of-requests"> request count. </a></td>
</tr>
<tr>
<td> duration </td>
<td> Duration through which chaos is injected into the target resource. Should be provided in <code>[numeric-hours]h[numeric-minutes]m[numeric-seconds]s</code> format. </td>
<td> Default: <code>30s</code>. Examples: <code>1m25s</code>, <code>1h3m2s</code>, <code>1h3s</code>. For more information, go to <a href="/docs/chaos-engineering/chaos-faults/common-tunables-for-all-faults#duration-of-the-chaos">duration.</a></td>
</tr>
<tr>
<td> rampTime </td>
<td> Period to wait before and after injecting chaos. Should be provided in <code>[numeric-hours]h[numeric-minutes]m[numeric-seconds]s</code> format. </td>
<td> Default: <code>0s</code>. Examples: <code>1m25s</code>, <code>1h3m2s</code>, <code>1h3s</code>. For more information, go to <a href="/docs/chaos-engineering/chaos-faults/common-tunables-for-all-faults#ramp-time">ramp time</a>. </td>
</tr>
</table>

### Number of requests

The `requestCount` input variable indicates the number of requests sent to access the Redis cache. Redis cache. Its default value is 1000.

The following YAML snippet illustrates the use of this input variable:

[embedmd]:# (./static/manifests/redis-cache-penetration/requests.yaml yaml)
```yaml
apiVersion: litmuchaos.io/v1alpha1
kind: LinuxFault
metadata:
name: redis-cache-penetration
labels:
name: cache-penetration
spec:
redisChaos/inputs:
duration: 30s
requestCount: 1000
rampTime: ""
```
19 changes: 19 additions & 0 deletions docs/chaos-engineering/chaos-faults/linux/shared/redis-auth.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
## 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="password"
TLS_AUTH_CERT="/path/to/tls-cert"
```

:::tip
`PASSWORD` and `TLS_AUTH_CERT` are optional, whereas `ADDRESS` is a mandatory field. You need them only if you have configured your Redis database to facilitate it.
:::


| **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` |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the hanging arrow

Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
apiVersion: litmuchaos.io/v1alpha1
kind: LinuxFault
metadata:
name: redis-cache-penetration
labels:
name: cache-penetration
spec:
redisChaos/inputs:
duration: 30s
requestCount: 1000
rampTime: ""