# Hoog geheugengebruik zonder verkeer?

**URL:** https://meta.discourse.org/t/high-memory-usage-without-traffic/228601
**Category:** Support
**Created:** [31 mei 2022 om 14:03 UTC](https://meta.discourse.org/t/high-memory-usage-without-traffic/228601 "2022-05-31T14:03:09Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![Haddoq](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/haddoq/32/258262_2.png) [@Haddoq](https://meta.discourse.org/u/Haddoq)
#### Post date: [31 mei 2022 om 14:03 UTC](https://meta.discourse.org/t/high-memory-usage-without-traffic/228601/1 "2022-05-31T14:03:09Z")

</div>

So I’m testing out Discourse as a possible destination for our existing forum and I’m trying to figure out the requirements.

Currently I’m running the Discourse droplet on a Digitalocean node with 4vCPUs and 8GB ram.

With the imported vbulletin site running here with no traffic and no activity, the system starts out using about 75% of that 8gb ram and over a few days goes up to 100% then stops responding completely.

This confuses me since the minimum required seems to be a lot less than this.

( I have rebuilt the container, I have checked and cleared sidekiq tasks, still high usage)

Anyone got any tips ro should I be looking at a monster RAM setup just to keep the forum up?

---

<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: [31 mei 2022 om 17:12 UTC](https://meta.discourse.org/t/high-memory-usage-without-traffic/228601/2 "2022-05-31T17:12:24Z")

</div>

How many posts were imported?

The system may be rebaking posts and re-sizing images, which could use a lot of resources even if you have no users. You can look at `/sidekiq` to see if there are a bunch of jobs queued and/or running. Also, `htop` may give you some hints about what’s running.

---

<div class="post-metadata">

### Author: ![Haddoq](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/haddoq/32/258262_2.png) [@Haddoq](https://meta.discourse.org/u/Haddoq)
#### Post date: [1 juni 2022 om 11:06 UTC](https://meta.discourse.org/t/high-memory-usage-without-traffic/228601/3 "2022-06-01T11:06:04Z")

</div>

About 240,000 posts.

Import was about 5 weeks ago, been through 5 app rebuilds since that seems to be what solves the memory issue once the container goes into 100% mem unresponsiveness.

Cleared all tasks in sidekiq as mentioned and the usage is still at 75%

The memory graph since I rebuilt the server yesterday:

\*_Ram: 8GB_

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

**CPU**

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

**Traffic**

 ![image](https://global.discourse-cdn.com/meta/original/4X/e/0/f/e0f40e07cfe698a69684bd3a21f897e26a55437a.png)

**Sidekiq**

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

---

<div class="post-metadata">

### Author: ![Haddoq](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/haddoq/32/258262_2.png) [@Haddoq](https://meta.discourse.org/u/Haddoq)
#### Post date: [1 juni 2022 om 11:07 UTC](https://meta.discourse.org/t/high-memory-usage-without-traffic/228601/4 "2022-06-01T11:07:03Z")

</div>

To me, this looks like it is slowly leaking memory to it’s death in a few days.. (which has been the observed behavior so far.

---

<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: [1 juni 2022 om 11:19 UTC](https://meta.discourse.org/t/high-memory-usage-without-traffic/228601/5 "2022-06-01T11:19:15Z")

</div>

After importing, it’s always a good idea for database performance to create a backup and restore it into the same instance.

Is that memory graph including or excluding cache? (i.e. what does the output of `free -m` look like?)

Any plugins?

---

<div class="post-metadata">

### Author: ![Haddoq](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/haddoq/32/258262_2.png) [@Haddoq](https://meta.discourse.org/u/Haddoq)
#### Post date: [1 juni 2022 om 11:21 UTC](https://meta.discourse.org/t/high-memory-usage-without-traffic/228601/6 "2022-06-01T11:21:23Z")

</div>

![image](https://global.discourse-cdn.com/meta/original/4X/6/e/f/6ef38ecd63644a9ce7807f01e56822ae4d2e268e.png)

```plaintext
## Plugins go here
## see https://meta.discourse.org/t/19157 for details
hooks:
  after_code:
    - exec:
        cd: $home/plugins
        cmd:
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://github.com/discourse/discourse-data-explorer.git
          - git clone https://github.com/discourse/discourse-solved.git
          - git clone https://github.com/discourse/discourse-cakeday.git
          - git clone https://github.com/discourse/discourse-spoiler-alert.git
          - git clone https://github.com/discourse/discourse-user-card-badges.git
          - git clone https://github.com/discourse/discourse-adplugin.git

```

---

<div class="post-metadata">

### Author: ![Haddoq](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/haddoq/32/258262_2.png) [@Haddoq](https://meta.discourse.org/u/Haddoq)
#### Post date: [1 juni 2022 om 11:21 UTC](https://meta.discourse.org/t/high-memory-usage-without-traffic/228601/7 "2022-06-01T11:21:50Z")

</div>

> [@RGJ](#):
>
> After importing, it’s always a good idea for database performance to create a backup and restore it into the same instance.

Good idea. def something I’ll try

---

<div class="post-metadata">

### Author: ![Haddoq](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/haddoq/32/258262_2.png) [@Haddoq](https://meta.discourse.org/u/Haddoq)
#### Post date: [1 juni 2022 om 12:30 UTC](https://meta.discourse.org/t/high-memory-usage-without-traffic/228601/8 "2022-06-01T12:30:42Z")

</div>

So that rendered the site unresponsive.. (Backed up.. restored backup and then rebooted)

 ![image](https://global.discourse-cdn.com/meta/original/4X/7/1/c/71c80dce29f1bb9da2e63cf0178bd8f005c09dcd.png)

Ram usage up from 6GB to 7GB and site not responding.

---

<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: [1 juni 2022 om 16:24 UTC](https://meta.discourse.org/t/high-memory-usage-without-traffic/228601/9 "2022-06-01T16:24:53Z")

</div>

There is almost 5GB being used by Redis, so that leaves Discourse with little to work with, specially considering how many unicorns you are running.

If your sidekiq queue is clean, try cleaning Redis since it may have too much garbage from the import:

```plaintext
./launcher enter app
redis-cli flushall

```

---

<div class="post-metadata">

### Author: ![Haddoq](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/haddoq/32/258262_2.png) [@Haddoq](https://meta.discourse.org/u/Haddoq)
#### Post date: [1 juni 2022 om 16:44 UTC](https://meta.discourse.org/t/high-memory-usage-without-traffic/228601/10 "2022-06-01T16:44:59Z")

</div>

Gotcha I’ll try the redis command.

The unicorn worker issue was one that I checked on fairly early. I changed both the ram usage for db\_shared\_buffers and also set the unicorn workers to 3.

The unicorn workers setting seems to have little to no effect on the number of workers that actually run though

**From my app.yml file**

```plaintext
  ## How many concurrent web requests are supported? Depends on memory and CPU cores.
  ## will be set automatically by bootstrap based on detected CPUs, or you can override
  UNICORN_WORKERS: 3

```

---

<div class="post-metadata">

### Author: ![Haddoq](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/haddoq/32/258262_2.png) [@Haddoq](https://meta.discourse.org/u/Haddoq)
#### Post date: [1 juni 2022 om 16:48 UTC](https://meta.discourse.org/t/high-memory-usage-without-traffic/228601/11 "2022-06-01T16:48:29Z")

</div>

> [@Falco](#):
>
> `redis-cli flushall`

That flushall command did wonders.. down to 2gb used.. we’ll see if this keeps now.

The worrysome part was that stuff just kept growing before. Hopefully this allows the app to self manage better.

Anyways.. so the import keeps things permanently in redis? seems odd but I have no clue how redis works so

Thanks a load for the help

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

---

<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: [1 juli 2022 om 16:49 UTC](https://meta.discourse.org/t/high-memory-usage-without-traffic/228601/12 "2022-07-01T16:49:00Z")

</div>

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