# 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:** 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:** 20
**Page:** 1

<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 15, 2025, 5:47am UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/1 "2025-01-15T05:47:35Z")

</div>

I recently updated Discourse from version 3.4.0.beta1 to 3.4.0.beta3. After the update, we are noticing that the forum’s memory usage is gradually increasing, causing the application to go down. When checking the server, we can see that the redis-server is consuming 95% of the memory.

We are running redis-cli flushall daily to temporarily fix the issue. The Discourse instance is hosted in Docker.

I tried to downgrade to the previous version, but it was throwing a few errors while rebuilding.

 ![image](https://global.discourse-cdn.com/meta/original/4X/8/4/2/8423ad043f66d80f94792c1d682d97092aeb6273.png)

---

<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 16, 2025, 6:08am UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/2 "2025-01-16T06:08:47Z")

</div>

May I know how to fix this? Is it possible to downgrade to the previous version, or do you have any other suggestions?

---

<div class="post-metadata">

### Author: ![Jagster](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jagster/32/192154_2.png) [@Jagster](https://meta.discourse.org/u/Jagster)
#### Post date: [January 16, 2025, 6:33am UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/3 "2025-01-16T06:33:03Z")

</div>

I don’t know how to fix Redis, but I’ve red something similar at some point. Searching may help.

But downgrading is mostly a bad idea.

> [@Downgrade to stable?](https://meta.discourse.org/t/downgrade-to-stable/33729):
>
> If a site changes from tests-passed to stable, is the app’s code base downgraded, or is it more like Chromium OS and you have to wait for stable to “catch up” to where you are?

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [January 16, 2025, 8:13am UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/4 "2025-01-16T08:13:13Z")

</div>

You cannot downgrade Discourse.  
Redis is not using 95% of the memory but 38.9%. Still a lot.

What does your Sidekiq queue look like? `/sidekiq/queues`

---

<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 16, 2025, 8:35am UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/5 "2025-01-16T08:35:03Z")

</div>

Please find the details of `/sidekiq/queues`

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/a/7/aa777ff897d1d16182201b69cd19b6ed12396df5.jpeg)

Let me know if you need any other details

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [January 16, 2025, 10:51am UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/6 "2025-01-16T10:51:46Z")

</div>

Are these emails jobs by any chance?

---

<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 16, 2025, 11:24am UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/7 "2025-01-16T11:24:20Z")

</div>

I doubt it. How can I check it?

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [January 16, 2025, 11:36am UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/8 "2025-01-16T11:36:27Z")

</div>

Click on the queue

---

<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 16, 2025, 11:59am UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/9 "2025-01-16T11:59:50Z")

</div>

May I know if you’re talking about this queues section?

 ![image](https://global.discourse-cdn.com/meta/original/4X/a/5/a/a5a2efab7c3f097e138a9bf23ed6efb8feb1c9cd.jpeg)

One more thing is under `/sidekiq/scheduler/history` I can find Jobs::Chat::EmailNotifications still running for a longer period

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/6/3/7632ccb8954c9b29ebe1fdf8dc6d12d51ae19378.png)

---

<div class="post-metadata">

### Author: ![RGJ](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/rgj/32/523185_2.png) [@RGJ](https://meta.discourse.org/u/RGJ)
#### Post date: [January 16, 2025, 12:30pm UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/10 "2025-01-16T12:30:58Z")

</div>

> [@Siraj\_Moideen](#):
>
> May I know if you’re talking about this queues section?

Yes, just click on the word “low”

 ![image](https://global.discourse-cdn.com/meta/original/4X/b/c/0/bc03da79abc5b3de68bb1c8c55d1c4854fc6ffaa.png)

---

<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 16, 2025, 8:09pm UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/11 "2025-01-16T20:09:05Z")

</div>

Please find the details below

 ![image](https://global.discourse-cdn.com/meta/original/4X/b/4/e/b4e1748d10b3a1be34e8d93b27ef1c8f9a008dfa.jpeg)

---

<div class="post-metadata">

### Author: ![Canapin](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/canapin/32/119591_2.png) [@Canapin](https://meta.discourse.org/u/Canapin)
#### Post date: [January 16, 2025, 8:32pm UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/12 "2025-01-16T20:32:17Z")

</div>

There’s an identical issue here:

> [@More then 3 million enqueued jobs show in sidekiq? How to I stop it generate the queue?](https://meta.discourse.org/t/more-then-3-million-enqueued-jobs-show-in-sidekiq-how-to-i-stop-it-generate-the-queue/346542/11):
>
> One thing I noticed is that the sidekiq queue issue started right after I upgraded to 3.4.0.beta4-dev, the other instance I installed around the same time seems to have the issue too (confirming now) also looked at the ids, it seems the system is trying to send chat summary to every users thinking is it normal? update: Turning off chat prevents those jobs from being queued again, but my si…

With maybe a fix:

> [@More then 3 million enqueued jobs show in sidekiq? How to I stop it generate the queue?](https://meta.discourse.org/t/more-then-3-million-enqueued-jobs-show-in-sidekiq-how-to-i-stop-it-generate-the-queue/346542/11):
>
> I turned off the chat function for 2 days, turned it on again, and changed the Chat channel retention days from 180 to 3 days. Now it seems to work fine, will keep an eye on it still.

Since you’re not the only one to experience this, that looks like a bug. 🤔

---

<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 17, 2025, 7:52am UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/13 "2025-01-17T07:52:22Z")

</div>

Thanks, but I don’t think I can turn off the chat. I’ll try to figure out another way

---

<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

```

---

<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 27, 2025, 9:00am UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/15 "2025-01-27T09:00:16Z")

</div>

Update: Seems like it’s been auto-fixed. Now that I’m remembering, we had a similar issue last time when we updated the version, and the memory kept spiking, but it fixed itself after a while. It seems like it’s a bug.

---

<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 28, 2025, 6:27am UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/16 "2025-01-28T06:27:10Z")

</div>

Update: I stopped the app and started it again, I started face the same issue 🙂

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [January 30, 2025, 1:31pm UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/17 "2025-01-30T13:31:58Z")

</div>

122M enqueued jobs is definitely showing something’s wrong 🤔

How many users do you have on your Discourse?  
How many #chat channels are there?  
How many users are there in your TOP 3 biggest chat channels?

---

<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 31, 2025, 9:36am UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/18 "2025-01-31T09:36:20Z")

</div>

3,4 chat groups have over 2 lakh members

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [January 31, 2025, 10:09am UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/19 "2025-01-31T10:09:34Z")

</div>

> [@Siraj\_Moideen](#):
>
> 2 lakh members

I’m not familiar with “lakh” but google says it’s 100,000 😮 is that correct?

---

<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: [February 3, 2025, 10:44am UTC](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197/20 "2025-02-03T10:44:26Z")

</div>

Yes, the exact number is 227,254 members in a single group. We have similar members in 2 or 3 other groups

[Next page](https://meta.discourse.org/t/redis-memory-keeps-increasing-in-discourse-3-4-0-beta3/347197.md?page=2)
