英文:
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的日志:
英文:
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
答案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
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论