# Redis\_data & Postgres\_data are eating my 20GB+ Space

**URL:** https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002
**Category:** Support
**Tags:** postgres
**Created:** [December 6, 2024, 7:17pm UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002 "2024-12-06T19:17:03Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![Vikash\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vikash_kumar/32/370583_2.png) [@Vikash\_Kumar](https://meta.discourse.org/u/Vikash_Kumar)
#### Post date: [December 6, 2024, 7:17pm UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002/1 "2024-12-06T19:17:04Z")

</div>

What I can do about this? redis\_date & Postgres\_date are eating my 20GB+ Space

Due to this, I am paying more on the digital ocean.

My forum: [https://onehourforum.com/](https://onehourforum.com/)

Everytime these two folder are taking much of my space, and my forum is getting down.

Please help.

Screenshot attached.

 ![Screenshot 2024-12-07 at 12.41.18 AM](https://global.discourse-cdn.com/meta/original/4X/e/3/d/e3deea6b93622e4b6cc99aa35a91e747e568c265.png)

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [December 6, 2024, 8:08pm UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002/2 "2024-12-06T20:08:02Z")

</div>

For me redis\_data is very small indeed. What do you get from

```plaintext
ls -haltrR /var/discourse/shared/standalone/redis_data

```

---

<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: [December 6, 2024, 8:12pm UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002/3 "2024-12-06T20:12:34Z")

</div>

I have

```plaintext
root@foorumi-hel:/var/discourse# ls -haltrR /var/discourse/shared/standalone/redis_data
/var/discourse/shared/standalone/redis_data:
total 9.3M
drwxr-xr-x 13 root root 4.0K Jan 10 2023 ..
-rw-r--r-- 1 messagebus input 9.3M Dec 6 20:07 dump.rdb
drwxr-xr-x 2 messagebus input 4.0K Dec 6 20:07 .

```

So Vikash must have an issue indeed.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 6, 2024, 8:30pm UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002/4 "2024-12-06T20:30:53Z")

</div>

Agreed. I can’t imagine how there could be 16GB of redis. If you move to a new server, what’s in redis (typically) gets left behind, so one thing to do would be to just delete it and rebuild.

You can see what this says:

```plaintext
cd /var/discourse
./launcher enter app
redis-cli
info memory
exit
exit
exit

```

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [December 7, 2024, 5:36pm UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002/5 "2024-12-07T17:36:34Z")

</div>

Also, for interest, at the bottom of your forum’s sidekiq status page (forum.url/sidekiq) there’s a summary of Redis memory usage, including peak usage. (Also, uptime - might be interesting if uptime is very short, because maybe redis is crashing and restarting and leaving some disk clutter.)

(However, that’s memory usage, and the problem here seems to be disk usage.)

---

<div class="post-metadata">

### Author: ![Vikash\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vikash_kumar/32/370583_2.png) [@Vikash\_Kumar](https://meta.discourse.org/u/Vikash_Kumar)
#### Post date: [December 7, 2024, 11:12pm UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002/6 "2024-12-07T23:12:03Z")

</div>

> [@Ed\_S](#):
>
> ```plaintext
> ls -haltrR /var/discourse/shared/standalone/redis_data
> 
> ```

 ![Screenshot 2024-12-08 at 4.41.21 AM](https://global.discourse-cdn.com/meta/original/4X/f/f/8/ff866baae3eac645673fce4aef3300cbe8fb804a.png)n

see this, it is generating dump data

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 8, 2024, 2:28am UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002/7 "2024-12-08T02:28:35Z")

</div>

Presumably you can delete all the temp files.

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [December 8, 2024, 8:07am UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002/8 "2024-12-08T08:07:10Z")

</div>

Is this a [standard install](https://meta.discourse.org/t/142537?silent=true)? Does it have a history of being migrated from another machine? A quick search indicates that some kind of permissions problem, or other reason for redis to fail while saving/renaming, could be the cause.

This previous thread was, for me, inconclusive:  
[Discouse takes up a lot of disk space, mainly the redis\_data folder](https://meta.discourse.org/t/discouse-takes-up-a-lot-of-disk-space-mainly-the-redis-data-folder/255331)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 8, 2024, 11:26am UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002/9 "2024-12-08T11:26:22Z")

</div>

I think that they get left behind if redis shuts down before it can write it out. (But had no memory of writing that, so maybe I have it left in a temp file solfege/somewhere)

> [@Discouse takes up a lot of disk space, mainly the redis\_data folder](https://meta.discourse.org/t/discouse-takes-up-a-lot-of-disk-space-mainly-the-redis-data-folder/255331/12):
>
> Rebuild tried to do a clean shutdown, but I think it forces it after a certain amount of time. Reboots are required to apply kernel and library updates.

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [December 8, 2024, 11:38am UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002/10 "2024-12-08T11:38:19Z")

</div>

Those dates in the screenshot are in clumps at roughly 5 minute intervals - something isn’t working as it should!

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 8, 2024, 12:21pm UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002/11 "2024-12-08T12:21:41Z")

</div>

I didn’t notice that!

There’s certainly something wrong. It’s this an underpowered machine? It’s it running a bunch of AI stuff? (I don’t think so, but those are my best guesses)

If safe to delete them, which solves the immediate disk space issue.

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [December 8, 2024, 12:43pm UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002/12 "2024-12-08T12:43:11Z")

</div>

As a general checkup, which includes a check for processes being killed due to shortage of memory:

> [@Failed to bootstrap on first install](https://meta.discourse.org/t/failed-to-bootstrap-on-first-install/295475/6):
>
> It feels possible that you have too little memory (by which I mean RAM+swap) and yet 2+4 should be enough. Please run the following quick diagnostics and post the results:
> 
> ```plaintext
> cat /etc/lsb-release
> uptime
> df -h /
> free
> swapon
> vmstat 5 5
> dmesg|egrep -i "memory|oom|kill"
> ps auxrc
> 
> ```

---

<div class="post-metadata">

### Author: ![Vikash\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vikash_kumar/32/370583_2.png) [@Vikash\_Kumar](https://meta.discourse.org/u/Vikash_Kumar)
#### Post date: [December 8, 2024, 12:43pm UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002/13 "2024-12-08T12:43:21Z")

</div>

The smtp service was stopped,

and the queue were there,

is that an issue?

What I did?

fixed smtp, and deleted temp files.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 8, 2024, 3:41pm UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002/14 "2024-12-08T15:41:40Z")

</div>

That could explain it.

---

<div class="post-metadata">

### Author: ![Ed\_S](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/ed_s/32/134015_2.png) [@Ed\_S](https://meta.discourse.org/u/Ed_S)
#### Post date: [December 8, 2024, 3:58pm UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002/15 "2024-12-08T15:58:57Z")

</div>

It will be interesting to see if those temp files are still being created.

---

<div class="post-metadata">

### Author: ![Vikash\_Kumar](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/vikash_kumar/32/370583_2.png) [@Vikash\_Kumar](https://meta.discourse.org/u/Vikash_Kumar)
#### Post date: [December 8, 2024, 8:34pm UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002/16 "2024-12-08T20:34:19Z")

</div>

No temp files are not created now.

 ![Screenshot 2024-12-09 at 2.02.08 AM](https://global.discourse-cdn.com/meta/original/4X/d/1/4/d14af8b0a2c57fc75b683206a948a7404ecfb1b0.png)

but this one is eating 16GB

 ![Screenshot 2024-12-09 at 2.03.32 AM](https://global.discourse-cdn.com/meta/original/4X/b/5/4/b549ba9db861cb88ed906285839bddf1e010d305.png)

how to deal with it?

Thanks

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [December 8, 2024, 8:41pm UTC](https://meta.discourse.org/t/redis-data-postgres-data-are-eating-my-20gb-space/341002/17 "2024-12-08T20:41:08Z")

</div>

You can try

```plaintext
cd /var/discourse
./launcher cleanup

```
