# Redis Memory Keeps Increasing in Discourse 3.4.0.beta3

**URL:** <https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197>\
**Category:** Product Support\
**Created:** [January 15, 2025, 5:47am UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197 "2025-01-15T05:47:35Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

**Author:** ![Siraj\_Moideen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/siraj_moideen/32/480987_2.png) [@Siraj\_Moideen](https://meta.discourse.org/u/Siraj_Moideen)\
**Post date:** [January 23, 2025, 6:36am UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/14 "2025-01-23T06:36:52Z")

</div>

As a temporary fix, I created a small bash script to clean up Redis memory and set it to run every day at 6 AM using a cron job.  
Note: I’m saving the log in /home/ubuntu/logs. You can ignore it if you don’t need it.

```plaintext
#!/bin/bash

# Set log directory and filename
LOG_DIR="/home/ubuntu/logs"
LOG_FILE="$LOG_DIR/redis.cleanup.$(date +\%Y-\%m-\%d).log"

# Ensure the log directory exists
mkdir -p "$LOG_DIR"

# Log information about the current environment (host side)
echo "Running script at $(date)" >> "$LOG_FILE"

# Run the discourse launcher in the app and save output to the log file (host side)
echo "redis cleanup command" >> "$LOG_FILE"
docker exec app redis-cli flushall >> "$LOG_FILE" 2>&1

# Indicate that the script is done (host side) and exit
echo "Script completed successfully at $(date)" >> "$LOG_FILE"
exit 0

```

---

_[View the full topic](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197)._
