如何在 Docker 镜像中增加 ActiveMQ 的堆内存?

huangapple go评论76阅读模式
英文:

How can i increase the heap memory for activeMQ inside a docker image

问题

我正在使用 rmohr/activemq 的 ActiveMQ Docker 镜像。当前配置是 -Xms64M -Xmx1G,我需要将其增加到 -Xms2g -Xmx3g

我正在使用 Docker Compose。以下是 docker-compose.yml 文件的条目:

version: '3'
services:
  queue:
    image: rmohr/activemq:5.15.6
    ports:
      - "8161:8161"
      - "61616:61616"
英文:

I am using rmohr/activemq activemq docker image. Right now it is -Xms64M -Xmx1G. I need to increase it to -Xms2g -Xmx3g.

I am using docker-compose. Here are the docker-compose.yml file entries:

    version: '3'
    services:
      queue:
        image: rmohr/activemq:5.15.6
        ports:
          - "8161:8161"
          - "61616:61616"

答案1

得分: 3

我最终在环境下添加了ACTIVEMQ_OPTS参数来解决这个问题。

以下是docker-compose文件的内容:

version: '3'
  services:
    queue:
      image: rmohr/activemq:5.15.6
      ports:
        - "8161:8161"
        - "61616:61616"    
      environment:
        ACTIVEMQ_OPTS: "-Xms2g -Xmx3g"

以下是activemq的日志:

如何在 Docker 镜像中增加 ActiveMQ 的堆内存?

英文:

I ended up adding the ACTIVEMQ_OPTS parameter under environment to resolve this.

Here is what the docker-compose file looks like:

version: '3'
  services:
    queue:
      image: rmohr/activemq:5.15.6
      ports:
        - "8161:8161"
        - "61616:61616"    
      environment:
        ACTIVEMQ_OPTS: "-Xms2g -Xmx3g"

Here are the logs from activemq

如何在 Docker 镜像中增加 ActiveMQ 的堆内存?

答案2

得分: 0

version: "3"
services:
  queue:
    image: rmohr/activemq:5.15.6
    ports:
      - "8161:8161"
      - "61616:61616"
    environment:
        ACTIVEMQ_OPTS_MEMORY: "-Xms2g -Xmx3g"
    deploy:
      resources:
        limits:
          cpus: '0.50' #根据需求设置内存和CPU时间
          memory: 3g
        reservations:
          cpus: '0.25'
          memory: 2g

请参考链接Active MQ内存增加ACTIVEMQ_OPTS_MEMORY环境变量用法

英文:
version: "3"
services:
  queue:
    image: rmohr/activemq:5.15.6
    ports:
      - "8161:8161"
      - "61616:61616"
    environment:
        ACTIVEMQ_OPTS_MEMORY: "-Xms2g -Xmx3g"
    deploy:
      resources:
        limits:
          cpus: '0.50' #set the memory and CPU time based on requirement
          memory: 3g
        reservations:
          cpus: '0.25'
          memory: 2g

Please refer link , Active MQ memory increase ,ACTIVEMQ_OPTS_MEMORY environment variable usage

huangapple
  • 本文由 发表于 2020年1月7日 02:49:22
  • 转载请务必保留本文链接:https://go.coder-hub.com/59617405.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定