# Occasionally very high CPU load

**URL:** https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336
**Category:** Support
**Created:** [October 11, 2025, 6:55pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336 "2025-10-11T18:55:09Z")
**Posts on this page:** 20
**Page:** 1

<div class="post-metadata">

### Author: ![GeorgSeifert](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@GeorgSeifert](https://meta.discourse.org/u/GeorgSeifert)
#### Post date: [October 11, 2025, 6:55pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/1 "2025-10-11T18:55:09Z")

</div>

Occasionally I get very high CPU load. Generally the operation is very smooth but then there are those burst of full CPU load. While that is happening, the forum give 502 errors or is VERY slow. I have a Hetzner server with 3 vCPUs and 4 GB of RAM.

 ![Bildschirmfoto 2025-10-11 um 20.43.18](https://global.discourse-cdn.com/meta/original/4X/c/6/3/c63e440632344fa04cb2e702562168d980f0c435.png)

Anyone has an idea what could cause this?

---

<div class="post-metadata">

### Author: ![GeorgSeifert](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@GeorgSeifert](https://meta.discourse.org/u/GeorgSeifert)
#### Post date: [October 11, 2025, 6:56pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/2 "2025-10-11T18:56:10Z")

</div>

This is what the console in the Hetzner backend shoes:

 ![Bildschirmfoto 2025-10-11 um 20.43.06](https://global.discourse-cdn.com/meta/original/4X/f/a/d/fadbf2d6e25b87af3e442e2a7556e8255c2173b1.jpeg)

---

<div class="post-metadata">

### Author: ![Richie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/richie/32/115110_2.png) [@Richie](https://meta.discourse.org/u/Richie)
#### Post date: [October 11, 2025, 7:01pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/3 "2025-10-11T19:01:10Z")

</div>

> [@GeorgSeifert](#):
>
> Anyone has an idea what could cause this?

Can you run `htop` or similar on the server, to identify the process name which is causing the high CPU load?

---

<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: [October 11, 2025, 9:39pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/4 "2025-10-11T21:39:47Z")

</div>

A periodic process is running. Do you have swap? You’re running out of memory. I would add 2 to 4gb of swap.

---

<div class="post-metadata">

### Author: ![GeorgSeifert](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@GeorgSeifert](https://meta.discourse.org/u/GeorgSeifert)
#### Post date: [October 13, 2025, 6:49pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/5 "2025-10-13T18:49:55Z")

</div>

I had to wait to catch an high CPU event. I ran htop and took some screenshots (I never used it so I don’t know what I’m looking at).

 ![Bildschirmfoto 2025-10-13 um 20.42.31](https://global.discourse-cdn.com/meta/original/4X/7/4/8/748607625dc7af4b733d497b4a2b42b5f1c2fd86.jpeg)

 ![Bildschirmfoto 2025-10-13 um 20.43.30](https://global.discourse-cdn.com/meta/original/4X/d/c/7/dc7d624ed4fe1471ae5b0e29dd5a1a2ed9416ca1.jpeg)

 ![Bildschirmfoto 2025-10-13 um 20.43.55](https://global.discourse-cdn.com/meta/original/4X/e/9/b/e9b374b89eab4a9fbd79e374366c794616235b9d.jpeg)

 ![Bildschirmfoto 2025-10-13 um 20.43.02](https://global.discourse-cdn.com/meta/original/4X/a/4/d/a4dcec2f2aae630585df9e84f2dbfca389bf4ce5.jpeg)

 ![Bildschirmfoto 2025-10-13 um 20.43.09](https://global.discourse-cdn.com/meta/original/4X/4/9/9/4998527a9f4a3dcc292a03c55b5d3727616f3af4.jpeg)

 ![Bildschirmfoto 2025-10-13 um 20.42.56](https://global.discourse-cdn.com/meta/original/4X/2/7/b/27b0e7c94f7d6622d2f7c24cb25711e5faa552d9.jpeg)

 ![Bildschirmfoto 2025-10-13 um 20.42.51](https://global.discourse-cdn.com/meta/original/4X/3/a/d/3ad23479eebf6faf7f18da98e6f2852302df61d2.jpeg)

 ![Bildschirmfoto 2025-10-13 um 20.42.44](https://global.discourse-cdn.com/meta/original/4X/f/d/6/fd61ced45c1c3692576c205b1be1e032f82b665d.jpeg)

---

<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: [October 14, 2025, 4:34pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/6 "2025-10-14T16:34:00Z")

</div>

> [@pfaffman](#):
>
> Do you have swap? You’re running out of memory. I would add 2 to 4gb of swap.

This is the first thing to do.

---

<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: [October 14, 2025, 5:03pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/7 "2025-10-14T17:03:48Z")

</div>

No swap is not a good look here, you are dangerously close to major issues.

---

<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: [October 22, 2025, 2:47pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/8 "2025-10-22T14:47:31Z")

</div>

@GeorgSeifert were you able to resolve your issue?

If adding swap is the fix, please mark @pfaffman’s [post](https://meta.discourse.org/t/occasionally-very-hight-cpu-load/385336/3) as the solution. It’s the button on the post menu that looks like a square with a checkmark in it.

---

<div class="post-metadata">

### Author: ![GeorgSeifert](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@GeorgSeifert](https://meta.discourse.org/u/GeorgSeifert)
#### Post date: [October 22, 2025, 3:12pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/9 "2025-10-22T15:12:38Z")

</div>

I tried a different sever that has more RAM but slower CPU and is cheaper. I’ll monitor this for a few days.

---

<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: [October 22, 2025, 3:18pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/10 "2025-10-22T15:18:47Z")

</div>

Did you add swap? That is essential.

---

<div class="post-metadata">

### Author: ![GeorgSeifert](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@GeorgSeifert](https://meta.discourse.org/u/GeorgSeifert)
#### Post date: [October 22, 2025, 3:50pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/11 "2025-10-22T15:50:20Z")

</div>

I thought double the physical RAM should do for now.

The Discourse page says that a server with 1-2 MB RAM is enough to run it. So I thought I’m kind of save with 4 MB? Now it has 8.

I’m not sure if our forum has a lot trafic (I just check the Reports and it says 15 logged in and 1000 not logged in users).

---

<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: [October 22, 2025, 4:03pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/12 "2025-10-22T16:03:46Z")

</div>

> [@GeorgSeifert](#):
>
> The Discourse page says that a server with 1-2 MB RAM is enough to run it

It is enough — without plugins and few other things, like users and an active admin/moderator. That is absolut minimum and even forum itself can work, rebuilding will fail.

We have here quite few topics about that question and one kind consensus is 2 MB is enought for small forums, **if there is swap too**.

---

<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: [October 22, 2025, 4:08pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/13 "2025-10-22T16:08:57Z")

</div>

@pfaffman refresh my memory.. does the `./discourse-setup` command not create the swap file automatically?

@GeorgSeifert have you followed the [official install](https://meta.discourse.org/t/142537?silent=true) instructions to set up your site? If not it is goin to be hard for us to support you here. As everyone is telling you, you need to have a swap file, no matter how much memory you have, otherwise you will run into difficulties.

---

<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: [October 22, 2025, 4:47pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/14 "2025-10-22T16:47:15Z")

</div>

> [@GeorgSeifert](#):
>
> The Discourse page says that a server with 1-2 MB RAM is enough to run it. So I thought I’m kind of save with 4 MB? Now it has 8.

You often still need swap even with what should be more than enough memory. I think because processes see that more ram is available and they take it and when more RAM is needed it’s not available to other processes.

> [@tobiaseigen](#):
>
> @pfaffman refresh my memory.. does the `./discourse-setup` command not create the swap file automatically?

It does, but only if you have 2GB or less.

He likely did follow the [standard install](https://meta.discourse.org/t/142537?silent=true). It’s unclear why he’s running out of ram, but that’s the case. There’s some chance that adding actual RAM will solve the problem.

---

<div class="post-metadata">

### Author: ![GeorgSeifert](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@GeorgSeifert](https://meta.discourse.org/u/GeorgSeifert)
#### Post date: [October 22, 2025, 7:32pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/15 "2025-10-22T19:32:50Z")

</div>

I just did what the install page told me.

---

<div class="post-metadata">

### Author: ![GeorgSeifert](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@GeorgSeifert](https://meta.discourse.org/u/GeorgSeifert)
#### Post date: [October 22, 2025, 7:41pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/16 "2025-10-22T19:41:41Z")

</div>

So how do I check if I have swap enabled or not?

---

<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: [October 23, 2025, 9:13am UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/18 "2025-10-23T09:13:48Z")

</div>

Run the command `free -h`

---

<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: [October 23, 2025, 11:34pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/19 "2025-10-23T23:34:20Z")

</div>

Your htop images show 0 swap.

---

<div class="post-metadata">

### Author: ![GeorgSeifert](https://avatars.discourse-cdn.com/v4/letter/g/df788c/32.png) [@GeorgSeifert](https://meta.discourse.org/u/GeorgSeifert)
#### Post date: [October 24, 2025, 9:41am UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/20 "2025-10-24T09:41:29Z")

</div>

I have indeed no swap.

Might there anything be wrong with my install that is using too much memory?

Increasing the RAM seems to have fixed it for now.

---

<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: [October 25, 2025, 12:23pm UTC](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336/21 "2025-10-25T12:23:51Z")

</div>

If you had swap, as you should, you won’t need so much RAM.

Note that installations and updates demand a lot more memory than normal operation. memory=swap+RAM.

[Next page](https://meta.discourse.org/t/occasionally-very-high-cpu-load/385336.md?page=2)
