Configure Discourse Docker on servers with more RAM and CPU

When you install Discourse on an instance with 4GB or more you should consider the following:

Monitor your setup

If you elect to use a higher end setup we strongly recommend you set up monitoring using a service such as Prometheus, Datadog, or New Relic. You will need to analyze the results of configuration changes to reach an optimal setup.

Out of the box Discourse Docker ships with 3 web workers

Web workers are served via Pitchfork (a modern fork of Unicorn), each worker process is capable of serving one request at a time. You should have at least one worker per CPU core. Both UNICORN_WORKERS and db_shared_buffers are automatically tuned by the bootstrap process based on your server’s detected CPUs and RAM, but you can override them in your container template:

env: 
   # to raise to 6 workers 
   UNICORN_WORKERS: 6

Database shared buffers default to 256MB

As a guideline you want to dedicate up to 25% of the total memory available to postgres shared_buffers. To raise this:

params:
  db_shared_buffers: "1GB"

Be sure to install latest Discourse Docker

We update our base templates with various optimisations, be sure to update regularly to ensure you take advantage of it.

Last edited by @JammyDodger 2024-05-26T20:56:13Z

Last checked by @sam 2026-03-18T04:26:35Z

Check documentPerform check on document:
16 Likes