كم كمية الذاكرة العشوائية (RAM) اللازمة لاستضافة discourse مع خدمات أخرى؟

في منتديات Discourse، قرأت أن 1 جيجابايت كحد أقصى 2 جيجابايت من الذاكرة يجب أن تكون كافية، ومع ذلك، لا تعمل هاتان الخيارتان بسلاسة على موقعي الإلكتروني. وعند تشغيل ملف docker-compose الخاص بي بذاكرة 4 جيجابايت، يعمل بنسبة تتراوح بين 90% و95%، وهو أمر كبير. تشمل العناصر الأخرى في ملف docker-compose موقعًا إلكترونيًا ثابتًا مبنيًا بلغة HTML ووكيل بروكسي nginx. هل يمكنك إخباري إذا كانت هناك حيلة أو إعدادات في Discourse تجعله يعمل بسلاسة أكبر على ذاكرة وصول عشوائي أقل؟

You need to tweak the amount of workers and the DB buffer. So, the options you would need to tweak would be:

  • db_shared_buffers
  • UNICORN_WORKERS

Here you can see the estimates of usage per Unicorn

Discourse is able to run with 512MB of RAM its not a good experience but it’s possible. You issue is that Discourse reviews the server (as the whole node) resources and plans the resource usage to take advantage of as most resources as possible because Discourse makes the assumption it will run alone.

إعجاب واحد (1)

Can you share the docker-conpose file here so we can make appropriate suggestions?

Here is the docker-compose file. I had to remove some of the images links since I cannot post more than 2, however, this should be good. Where would I place the DB buffer environment variable?

version: '2'
services:
  nginx:
    image: ''
    #image: 'itshady/nginx'
    ports:
      - '80:80'
    depends_on:
      - discourse
  intellectus:
    image: '
#    image: 'itshady/intellectus'
    ports:
      - '90:80'
  postgresql:
    image: ''
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
    volumes:
      #- './data/postgresql:/bitnami/postgresql'
      - 'postgresql_data:/bitnami/postgresql'
  redis:
    image: ''
    environment:
      - ALLOW_EMPTY_PASSWORD=yes
    volumes:
      - 'redis_data:/bitnami'
  discourse:
    image: 'docker.io/bitnami/discourse:2-debian-10'        #2-debian-10
    ports:
      - '100:3000'
    depends_on:
      - postgresql
      - redis
    volumes:
      - './data/discourse:/bitnami'
    environment:
      - POSTGRESQL_HOST=postgresql
      - POSTGRESQL_ROOT_USER=postgres
      - POSTGRESQL_CLIENT_CREATE_DATABASE_NAME=bitnami_application
      - POSTGRESQL_CLIENT_CREATE_DATABASE_USERNAME=bn_discourse
      - POSTGRESQL_CLIENT_CREATE_DATABASE_PASSWORD=bitnami1
      - DISCOURSE_POSTGRESQL_NAME=bitnami_application
      - DISCOURSE_POSTGRESQL_USERNAME=bn_discourse
      - DISCOURSE_POSTGRESQL_PASSWORD=bitnami1
      #- DISCOURSE_HOSTNAME=forums.intellectus.ca
      - DISCOURSE_HOSTNAME=${FORUM_URL}
      - DISCOURSE_EMAIL=
      - SMTP_HOST=
      - SMTP_PORT=
      - SMTP_USER=
      - SMTP_PASSWORD=
  sidekiq:
    image: 'docker.io/bitnami/discourse:2-debian-10'
    depends_on:
      - discourse
    volumes:
      - './data/discourse:/bitnami'
    command: 'nami start --foreground discourse-sidekiq'
    environment:
      - DISCOURSE_POSTGRESQL_NAME=bitnami_application
      - DISCOURSE_POSTGRESQL_USERNAME=bn_discourse
      - DISCOURSE_POSTGRESQL_PASSWORD=bitnami1
      - DISCOURSE_HOST=discourse
      - DISCOURSE_PORT=3000
      #- DISCOURSE_HOSTNAME=forums.intellectus.ca
      - DISCOURSE_HOSTNAME=${FORUM_URL}
      - SMTP_HOST=
      - SMTP_PORT=
      - SMTP_USER=
      - SMTP_PASSWORD=
volumes:
  postgresql_data:
    driver: local
#    external: true
  redis_data:
    driver: local
#    external: true
  discourse_data:
    driver: local
#    external: true

If you wrap your raw code with lines that contain only ``` they will be much easier to read.

As step one, I recommend that you use ./launcher to build and launch your Discourse instance. If you want, you can use ./launcher to build it and then launch it with docker-compose (at least I’ve done similar to build and launch Discourse images with kubernetes).

إعجاب واحد (1)

You are using bitnami images and those are completely unsupported by Discourse maintainers and will probably use more RAM than using the Discourse official Standard Installation

3 إعجابات

لماذا لا تزال صور Bitnami شائعة جدًا؟

أجيب على سؤالي بنفسي، يبدو أن Bitnami هو الخيار الوحيد المناسب لـ Docker، حيث تكون عمليات البناء حتمية وتركز على متغيرات البيئة. يستخدم Discourse بشكل افتراضي Docker ولكنه يعامله كأنظمة تمهيد لأنظمة البناء التقليدية التي تتطلب منك تسجيل الدخول عبر SSH والإعداد/الصيانة من خلال الطرفية.

إعجاب واحد (1)

هذا صحيح. إذا كنت تريد المساعدة هنا، فإنك تتبع التثبيت القياسي. إذا كنت تريد المساعدة من Bitnami، يمكنك استخدام صورتهم.

إعجابَين (2)

أعتقد أنك قد ترغب في قراءة هذا:

3 إعجابات