# Gaining space on an install in mailing list mode

**URL:** https://meta.discourse.org/t/gaining-space-on-an-install-in-mailing-list-mode/118424
**Category:** Self-hosting
**Created:** [22.Май.2019 16:01:07 UTC](https://meta.discourse.org/t/gaining-space-on-an-install-in-mailing-list-mode/118424 "2019-05-22T16:01:07Z")
**Posts on this page:** 13
**Page:** 1

<div class="post-metadata">

### Author: ![Jose\_C\_Gomez](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jose_c_gomez/32/137297_2.png) [@Jose\_C\_Gomez](https://meta.discourse.org/u/Jose_C_Gomez)
#### Post date: [22.Май.2019 16:01:08 UTC](https://meta.discourse.org/t/gaining-space-on-an-install-in-mailing-list-mode/118424/1 "2019-05-22T16:01:08Z")

</div>

Trying to recover some space on our server and our email\_log table is 2GB  
We use mailing list mode so we send approx 2 mil emails a month

 ![image](https://global.discourse-cdn.com/meta/original/3X/a/0/a066d73c3f87ef05499eca92ba87efb45b2a355b.png)

Just wondering if there is a supported way to clean this up? I saw a few posts about clearing the email\_log table but that can have some repercussion in usability?

Is there a more appropriate place to clean up? I have trimmed our backups down to 1 and that helped. But I need to recoup several gigs.  
I am trying to get my storage upgraded but at the moment that isn’t a choice I can easily make.

Any other areas where I can clean up? I have done apt-get autoremove, and autopurge and launcher clean

Thanks!

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [22.Май.2019 16:06:07 UTC](https://meta.discourse.org/t/gaining-space-on-an-install-in-mailing-list-mode/118424/2 "2019-05-22T16:06:07Z")

</div>

Did you check the site setting `delete email logs after days` ?

---

<div class="post-metadata">

### Author: ![Jose\_C\_Gomez](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jose_c_gomez/32/137297_2.png) [@Jose\_C\_Gomez](https://meta.discourse.org/u/Jose_C_Gomez)
#### Post date: [22.Май.2019 16:08:04 UTC](https://meta.discourse.org/t/gaining-space-on-an-install-in-mailing-list-mode/118424/3 "2019-05-22T16:08:04Z")

</div>

Yes that’s set to 30 but I still have 2 GB in this table. Which I guess I can live with just trying to find other places to trim.

---

<div class="post-metadata">

### Author: ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)
#### Post date: [22.Май.2019 16:13:34 UTC](https://meta.discourse.org/t/gaining-space-on-an-install-in-mailing-list-mode/118424/5 "2019-05-22T16:13:34Z")

</div>

> [@pfaffman](#):
>
> I think that this will delete old email logs. I’d take a backup first, and wait for someone who knows what problems this might cause weighs in.
> 
> ```
> cd /var/discourse
> ./launcher enter app
> rails c
> EmailLog.where("DATE(created_at) < ?" , 1.month.ago).destroy_all
> 
> ```

That is exactly what the setting does, no need to run a console command.

> [@Jose\_C\_Gomez](#):
>
> Yes that’s set to 30 but I still have 2 GB in this table. Which I guess I can live with just trying to find other places to trim.

Set it to 15? Maybe 10?

After that, you will need to expand storage in the server.

---

<div class="post-metadata">

### Author: ![Jose\_C\_Gomez](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jose_c_gomez/32/137297_2.png) [@Jose\_C\_Gomez](https://meta.discourse.org/u/Jose_C_Gomez)
#### Post date: [22.Май.2019 16:14:37 UTC](https://meta.discourse.org/t/gaining-space-on-an-install-in-mailing-list-mode/118424/6 "2019-05-22T16:14:37Z")

</div>

So I currently have 26GB free which is great, however I’m still ruinning the old PostGre version. Have been having Perf issues lately so I really want to upgrade PostGre but it requires “double” the storage space to do that.  
I’ve been limping along with the old one, but I was hoping to get upgraded. I need like a couple of gigs to meet the “double” threshold required by postgre for upgrade.

---

<div class="post-metadata">

### Author: ![Jose\_C\_Gomez](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jose_c_gomez/32/137297_2.png) [@Jose\_C\_Gomez](https://meta.discourse.org/u/Jose_C_Gomez)
#### Post date: [22.Май.2019 16:16:27 UTC](https://meta.discourse.org/t/gaining-space-on-an-install-in-mailing-list-mode/118424/7 "2019-05-22T16:16:27Z")

</div>

Been running the 9.5 postgre template for like 6 months trying to find space… because of the nutty double space requirement. But lately my discourse slows to a crawl for no apparent reason, I don’t know what the issue is but I was hoping to eliminate that as an option by upgrading  
sigh

---

<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: [22.Май.2019 16:19:38 UTC](https://meta.discourse.org/t/gaining-space-on-an-install-in-mailing-list-mode/118424/8 "2019-05-22T16:19:38Z")

</div>

> [@Jose\_C\_Gomez](#):
>
> because of the nutty double space requirement.

It’s not nutty, it’s just math. The only way to do the upgrade is to make a copy of the database in the new format.

It is a bother, though.

You could do something like move to a new server or add another disk partition (a Volume if you’re on DigitalOcean) to temporarily gain space.

---

<div class="post-metadata">

### Author: ![Jose\_C\_Gomez](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jose_c_gomez/32/137297_2.png) [@Jose\_C\_Gomez](https://meta.discourse.org/u/Jose_C_Gomez)
#### Post date: [22.Май.2019 16:19:48 UTC](https://meta.discourse.org/t/gaining-space-on-an-install-in-mailing-list-mode/118424/9 "2019-05-22T16:19:48Z")

</div>

I’m leaning towards something to do with email. We send out a LOT of email and it seems like when we have a very active topic that’s when sh\*t hits the fan.  
But I haven’t been able to figure out where the bottle neck is. Usually I end up doing an app rebuild , reboot and it settles out.  
But within a few days it does it again. I know this is somewhat unrelated to the OP but if anyone has an idea… I’d love some thoughts.

---

<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: [22.Май.2019 16:53:46 UTC](https://meta.discourse.org/t/gaining-space-on-an-install-in-mailing-list-mode/118424/10 "2019-05-22T16:53:46Z")

</div>

You might need more sidekiq jobs. My guess is that it’s getting slammed sending all of those emails.

When it’s slow, have a look at /sidekiq. Also you might just need more RAM. How big is your database and how much RAM do you have?

---

<div class="post-metadata">

### Author: ![Jose\_C\_Gomez](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jose_c_gomez/32/137297_2.png) [@Jose\_C\_Gomez](https://meta.discourse.org/u/Jose_C_Gomez)
#### Post date: [22.Май.2019 17:13:21 UTC](https://meta.discourse.org/t/gaining-space-on-an-install-in-mailing-list-mode/118424/11 "2019-05-22T17:13:21Z")

</div>

Currently on Digital Ocean I have

DB Size: 17GB  
RAM: 3GB

---

<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: [22.Май.2019 17:42:17 UTC](https://meta.discourse.org/t/gaining-space-on-an-install-in-mailing-list-mode/118424/12 "2019-05-22T17:42:17Z")

</div>

I’d recommend that you bump up to 8GB. And re-run `discourse-setup` after you do to adjust the memory settings in your `app.yml`.

---

<div class="post-metadata">

### Author: ![tobiaseigen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tobiaseigen/32/539204_2.png) [@tobiaseigen](https://meta.discourse.org/u/tobiaseigen)
#### Post date: [22.Май.2019 17:44:32 UTC](https://meta.discourse.org/t/gaining-space-on-an-install-in-mailing-list-mode/118424/13 "2019-05-22T17:44:32Z")

</div>

You could also just rely more on offsite backups. I keep 3 local backups and the rest on amazon.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [21.Июнь.2019 17:44:33 UTC](https://meta.discourse.org/t/gaining-space-on-an-install-in-mailing-list-mode/118424/14 "2019-06-21T17:44:33Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
