# Discourse in a Docker container

**URL:** https://meta.discourse.org/t/discourse-in-a-docker-container/10844
**Category:** Self-hosting
**Tags:** hosting
**Created:** [November 8, 2013, 12:12am UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844 "2013-11-08T00:12:22Z")
**Posts on this page:** 9
**Page:** 2

<div class="post-metadata">

### Author: ![sedrickcz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sedrickcz/32/107916_2.png) [@sedrickcz](https://meta.discourse.org/u/sedrickcz)
#### Post date: [January 31, 2014, 9:44am UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/21 "2014-01-31T09:44:32Z")

</div>

Ok, these commands are great, but still nothing. I add text field to Registration form and column for it to user table. I am not able to see it. I tried to restart docker, restart unicorn with sv, clear assets and precompile them again. And still nothing. I know there must be a way how to do it. Thanks and sorry for noob questions.

I need this “hack” only temporarily, because we need to run this forum ASAP. And it’s buy me some time to do it correct way.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [February 1, 2014, 10:24am UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/22 "2014-02-01T10:24:13Z")

</div>

> [@sedrickcz](#):
>
> I add text field to Registration form and column for it to user table.

Don’t add it there, use PluginStore and write a plugin, mucking with core table columns is going to end in tears eventually.

---

<div class="post-metadata">

### Author: ![sedrickcz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sedrickcz/32/107916_2.png) [@sedrickcz](https://meta.discourse.org/u/sedrickcz)
#### Post date: [February 2, 2014, 4:36pm UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/23 "2014-02-02T16:36:23Z")

</div>

Ok, thanks for the warning 🙂 I have another question. On our forum we have very high load and our memory is swaping. We have 4GB, but we have on the server also a very visited web. So forum has ± 2GB Ram and we had same server failures caused by low memory. We run with 3 unicorn workers. Should I add more workers or remove one worker? thanks

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [February 2, 2014, 10:46pm UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/24 "2014-02-02T22:46:09Z")

</div>

If you have very high load on the forum (lots of visitors, lots of posts/topics, lots of logged in users) then I recommend running the forum with dedicated resources. It should be OK if you just have lots of anonymous users because of built-in caching.

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [February 2, 2014, 11:06pm UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/25 "2014-02-02T23:06:48Z")

</div>

I am curious, can you provide me the output of [http://www.selenic.com/smem/](http://www.selenic.com/smem/) on your server (you will need to download it).

3 \* Unicorns + 1 sidekiq should add up to less than a gig of usage.

---

<div class="post-metadata">

### Author: ![sedrickcz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sedrickcz/32/107916_2.png) [@sedrickcz](https://meta.discourse.org/u/sedrickcz)
#### Post date: [February 3, 2014, 12:15am UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/26 "2014-02-03T00:15:40Z")

</div>

Here is free output:

```
 ----- total used free shared buffers cached
Mem: 3499476 2659476 840000 0 16336 315964
-/+ buffers/cache: 2327176 1172300
Swap: 14069752 487864 13581888

```

And here is smem output:  
[smem.output.txt](https://global.discourse-cdn.com/meta/original/2X/5/5dd59db2396a28a1a44bb1f9685d0299e6e836ca.txt) (16.0 KB)

And here is the link to forum: [http://forum.kingdomcomerpg.com/](http://forum.kingdomcomerpg.com/)

---

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [February 3, 2014, 12:21am UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/27 "2014-02-03T00:21:24Z")

</div>

The output shows usage of unicorns + sidekiq of

```
. 
                                                       PSS RSS
24881 warhorse unicorn worker[1] -E produc 40080 96440 112023 144868 
24864 warhorse unicorn worker[0] -E produc 39072 101272 115879 147736 
24910 warhorse unicorn worker[2] -E produc 38828 108672 124858 158348 
17719 warhorse sidekiq 2.15.1 discourse [0 90108 165936 167375 170660 

```

In particular when you look at the PSS column (which is the only way to get accurate usage for a forked process we see only 500MB or so is used by discourse)

I would recommend

1. monitoring these numbers when you notice any out of memories
2. possibly adding another unicorn or 2 if capacity is an issue
3. explaining what is going on with apache on this server, why is it ever running, is anything it is running causing the runaway memory.

You appear to have plenty of swap space an a reasonable amount of free space (800MB or so)

---

<div class="post-metadata">

### Author: ![sedrickcz](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sedrickcz/32/107916_2.png) [@sedrickcz](https://meta.discourse.org/u/sedrickcz)
#### Post date: [February 3, 2014, 12:31am UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/28 "2014-02-03T00:31:37Z")

</div>

There is [kingdomcomerpg.com](http://kingdomcomerpg.com) wordpress website running on the same server. Both sites forum and homepage has very high traffic. We have 4GB memory, but today we will add 4GB more. We have this dedicated server: [The Best Web Hosting Services at 20x Speeds | hosting.com](http://www.a2hosting.com/flex-dedicated-hosting) Leverage settings.

ad 2) As I ask earlier. How can I add more unicorn workers? In unicorn.conf or with ENV and restart docker or how? Thanks.

---

<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: [January 31, 2023, 10:46pm UTC](https://meta.discourse.org/t/discourse-in-a-docker-container/10844/29 "2023-01-31T22:46:47Z")

</div>



[Previous page](https://meta.discourse.org/t/discourse-in-a-docker-container/10844.md?page=1)
