Discourse-docker 실행 시 unicorn 메모리 문제

최신 버전 discourse-docker로 docker를 실행했습니다. 메모리: 2GB, 3개의 unicorn 스레드.
아래와 같이 로그 오류가 많이 발생합니다.

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

같은 문제를 겪고 계신 분 계신가요?

비공식 플러그인을 실행 중이신가요? 아니면 서버에서 다른 프로그램을 실행 중이신가요? 2GB면 충분히 여유가 있어야 하는데…

답변 감사합니다. 서버에는 sidekiq와 discourse만 실행됩니다.

아래 명령어를 실행해 주시겠어요?

cd /var/discourse
./discourse-doctor

그리고 URL을 공유해 주세요.

@Falco
감사합니다. 아래는 doctor 결과입니다:

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 # (필수)
DEVELOPER_EMAILS=REDACTED 
SMTP_PASSWORD=REDACTED  (선택)
SMTP_PORT=25 # (선택)
SMTP_USER_NAME=# (선택)
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. 커널 버전이 상당히 오래되었습니다. 좀 더 최신 버전에서 실행할 수 있을까요?

  2. Docker 버전도 상당히 오래되었습니다. 지원되는 버전으로 업데이트할 수 있을까요?

  3. 현재 web_only 컨테이너를 실행 중이며, 이는 스탠얼론 컨테이너보다 메모리를 덜 사용합니다. 다만, 커스텀 플러그인을 여러 개 실행 중이며, 이 플러그인들이 과도한 메모리를 할당하고 있을 수도 있습니다.

  4. 운영체제의 스왑 설정(swapiness)을 확인해 보세요. 너무 낮게 설정되어 있을 수 있습니다.

  5. Unicorn 프로세스가 종료(reaped)되었습니다. 더 많은 로그가 없다면 원인을 파악하기 어렵습니다… 커스텀 플러그인이 외부 시스템에 인라인으로 요청을 보내고 있나요? 단순히 타임아웃이 발생한 것일 수도 있습니다.

단순 설치 환경과는 거리가 먼 변수가 너무 많으므로, 우선적으로 이러한 변수들을 줄이는 것을 시도해 보시기 바랍니다.

@Falco 감사합니다. 이 부분에 대해 메모리를 더 늘리겠습니다. 커널과 도커 업그레이드 관련해서는 SE 팀과 상의하여 결정하겠습니다.
메리 크리스마스. :dizzy: