# Tuning a Discourse server for performance

**URL:** <https://meta.discourse.org/t/tuning-a-discourse-server-for-performance/94927>\
**Category:** Self-hosting\
**Tags:** hosting\
**Created:** [August 16, 2018, 10:13pm UTC](https://meta.discourse.org/t/tuning-a-discourse-server-for-performance/94927 "2018-08-16T22:13:29Z")\
**Posts on this page:** 1\
**Showing post:** 9

<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:** [April 4, 2022, 9:37pm UTC](https://meta.discourse.org/t/tuning-a-discourse-server-for-performance/94927/9 "2022-04-04T21:37:41Z")

</div>

> [@haydenjames](#):
>
> can see memory usage becoming a future problem

There is always a point in time where some resource becomes a bottleneck. But your server currently looks heavily overdimensioned to me.

You will be using more memory when you have more Unicorn processes.  
You will need more Unicorn processes when you have more traffic on your site.

I see all Unicorn processes using 0.0% CPU and only worker[0] seems to be actually doing something.

> [@haydenjames](#):
>
> I was able to just about double available memory usage

You reduced memory by running less Unicorns. That’s good, because you didn’t seem to use them anyway. But available memory is actually a bad thing. You’re optimizing for the wrong variable.

Unused memory buys you nothing. It means you’re paying for something you’re not using anyway. If you have 2 GB available all the time\*, you could downsize your server and save some money.

\*_) Rebuilding Discourse will consume more memory so you need to check how much memory is available during rebuilding. In practice, don’t go under the 2 GB total and/or make sure you have enough swap as Pfaffman said already._

---

_[View the full topic](https://meta.discourse.org/t/tuning-a-discourse-server-for-performance/94927)._
