Discourse-docker run with unicorn memory issue

Run docker with the latest version discourse-docker, Mem: 2GB, 3 unicorn thread.
There tons of log error as below.

I, [2019-12-17T22:44:47.722151 #19487]  INFO -- : listening on addr=0.0.0.0:3000 fd=13
I, [2019-12-17T22:44:53.036892 #19487]  INFO -- : master process ready
I, [2019-12-17T22:44:55.704154 #19587]  INFO -- : worker=0 ready
I, [2019-12-17T22:44:56.644984 #19594]  INFO -- : worker=1 ready
I, [2019-12-17T22:44:57.595814 #19601]  INFO -- : worker=2 ready
I, [2019-12-18T05:12:51.517167 #19487]  INFO -- : reaped #<Process::Status: pid 19587 exit 0> worker=0
I, [2019-12-18T05:12:52.533342 #19487]  INFO -- : reaped #<Process::Status: pid 19594 exit 0> worker=1
Detected dead worker 19563, restarting...
I, [2019-12-18T05:12:53.551518 #19487]  INFO -- : reaped #<Process::Status: pid 19601 exit 0> worker=2
I, [2019-12-18T05:12:59.062671 #11689]  INFO -- : worker=1 ready
I, [2019-12-18T05:12:59.063307 #11680]  INFO -- : worker=0 ready
I, [2019-12-18T05:12:59.360555 #11706]  INFO -- : worker=2 ready
WARNING: V8 isolate was forked, it can not be disposed and memory will not be reclaimed till the Ruby process exits.
WARNING: V8 isolate was forked, it can not be disposed and memory will not be reclaimed till the Ruby process exits.
WARNING: V8 isolate was forked, it can not be disposed and memory will not be reclaimed till the Ruby process exits.
WARNING: V8 isolate was forked, it can not be disposed and memory will not be reclaimed till the Ruby process exits.
WARNING: V8 isolate was forked, it can not be disposed and memory will not be reclaimed till the Ruby process exits.
WARNING: V8 isolate was forked, it can not be disposed and memory will not be reclaimed till the Ruby process exits.
WARNING: V8 isolate was forked, it can not be disposed and memory will not be reclaimed till the Ruby process exits.
WARNING: V8 isolate was forked, it can not be disposed and memory will not be reclaimed till the Ruby process exits.
D, [2019-12-18T05:13:23.583306 #19487] DEBUG -- : waiting 16.0s after suspend/hibernation
I, [2019-12-18T05:13:44.194692 #19487]  INFO -- : reaped #<Process::Status: pid 11680 exit 0> worker=0
I, [2019-12-18T05:13:44.194960 #19487]  INFO -- : reaped #<Process::Status: pid 11689 exit 0> worker=1
I, [2019-12-18T05:13:44.195054 #19487]  INFO -- : reaped #<Process::Status: pid 11706 exit 0> worker=2
I, [2019-12-18T05:13:44.195120 #19487]  INFO -- : master complete
I, [2019-12-18T05:13:45.760881 #11795]  INFO -- : Refreshing Gem list

Any one have the same issue?

1 Like

Are you running any unofficial plugin? Or running anything else in the server? 2GB should be more than enough…

2 Likes

Thank you for reply. the server run sidekiq and discourse only.

Can you please run:

cd /var/discourse
./discourse-doctor

And share the URL with us?

@Falco
Many thanks, Here are the doctor results:

DISCOURSE DOCTOR Fri Dec 20 03:42:31 UTC 2019
OS: Linux int-communityweb-01w.our-internal-domain 3.10.0-1062.7.1.el7.x86_64 #1 SMP Mon Dec 2 17:33:29 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux


YML=web_only.yml
Found containers/web_only.yml

==================== YML SETTINGS ====================
DISCOURSE_HOSTNAME=int-communityweb-vip.our-internal-domain
SMTP_ADDRESS=our_smtp_server # (mandatory)
DEVELOPER_EMAILS=REDACTED 
SMTP_PASSWORD=REDACTED  (optional)
SMTP_PORT=25 # (optional)
SMTP_USER_NAME=# (optional)
LETSENCRYPT_ACCOUNT_EMAIL=REDACTED 

==================== DOCKER INFO ====================
DOCKER VERSION: Docker version 17.05.0-ce, build 89658be

DOCKER PROCESSES (docker ps -a)

CONTAINER ID        IMAGE                                                                                                             COMMAND             CREATED             STATUS                    PORTS                NAMES
e6c7024d0d4b        artifacts.our-internal-domain:8080/image/community:99-2.0.20191013-2320-tests-passed-b6b05d3b48-2019-12-16_09-28   "/sbin/boot"        43 hours ago        Up 43 hours               0.0.0.0:80->80/tcp   web_only
703de08548b0        artifacts.our-internal-domain:8080/image/community:90-2.0.20190625-0946-tests-passed-ac7d68a-2019-08-30_09-36      "/sbin/boot"        4 weeks ago         Exited (5) 46 hours ago                        web_only_bak


Discourse container web_only is running


==================== PLUGINS ====================
          - git clone https://github.com/discourse/docker_manager.git
          - git clone https://gitlab.our-internal-domain/community/community-sso-plugin.git
          - git clone https://gitlab.our-internal-domain/community/community-ads-plugin.git
          - git clone  --branch upgarde-newrelic-gem https://gitlab.our-internal-domain/community/community-newrelic-plugin.git

WARNING:
You have what appear to be non-official plugins.
If you are having trouble, you should disable them and try rebuilding again.

See https://github.com/discourse/discourse/blob/master/lib/plugin/metadata.rb for the official list.

========================================
Discourse version at int-communityweb-vip.our-internal-domain: Discourse 2.4.0.beta8 
Discourse version at localhost: Discourse 2.4.0.beta8 


==================== MEMORY INFORMATION ====================
OS: Linux
RAM (MB): 1882

              total        used        free      shared  buff/cache   available
Mem:           1838        1340          66           7         430         306
Swap:          3071         388        2683

==================== DISK SPACE CHECK ====================
---------- OS Disk Space ----------
Filesystem             Size  Used Avail Use% Mounted on
/dev/mapper/vg00-root   19G   15G  3.3G  82% /
/dev/mapper/vg00-root   19G   15G  3.3G  82% /var/lib/docker/overlay
/dev/mapper/vg00-root   19G   15G  3.3G  82% /

---------- Container Disk Space ----------


==================== DISK INFORMATION ====================

Disk /dev/sda: 21.5 GB, 21474836480 bytes, 41943040 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0005c8ec

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *        2048     1050623      524288   83  Linux
/dev/sda2         1050624    16777215     7863296   8e  Linux LVM
/dev/sdimage        16777216    41943039    12582912   8e  Linux LVM

Disk /dev/mapper/vg00-root: 19.9 GB, 19851640832 bytes, 38772736 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/mapper/vg00-swap: 1073 MB, 1073741824 bytes, 2097152 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

==================== END DISK INFORMATION ====================

==================== MAIL TEST ====================
For a robust test, get an address from http://www.mail-tester.com/
Mail test skipped.

==================== DONE! ====================

  1. Pretty old kernel in there, can you run on something a bit more modern?

  2. Pretty old docker version in there, can you update to a supported version?

  3. You are running a web_only container, which will use even less memory than a standalone one. That said, you are running a bunch of custom plugins, who may or not be allocating too much memmory.

  4. Check your OS swapiness, it may be too low.

  5. Your unicorn is reaped. Hard to know why without more logs… Do your custom plugins make requests to outside systems inline? Maybe it’s just timing out?

There are way too many variables in here distancing this from a simple install, so I’d try to reduce those first.

4 Likes

@Falco Thanks, I will add more memory for this. For the kernel and docker upgrade related, will talk to SE team to made the decision.
Merry Christmas. :dizzy:

2 Likes

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