Skip to content

Commit 1246f54

Browse files
committed
fix the issue #1 about XMX and XMS
1 parent 1696e1a commit 1246f54

5 files changed

Lines changed: 25 additions & 5 deletions

File tree

Changelog.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
11
# Changelog
22

3-
**v6.6.1**
3+
**v1.0.1
4+
- Add environment variabale to set MIN and MAX memory for ActiveMQ (issue #1)
5+
6+
**v1.0.0**
47
- upgraded to ActiveMQ 5.10.0

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,16 @@ Current Version: **5.10.0**
4141
- 512MB is too little memory, i think is to use ActiveMQ on test environment
4242
- **1GB** is the **standard** memory size
4343

44+
You can set the memory that you need :
45+
46+
```bash
47+
docker run ... \
48+
-e 'ACTIVEMQ_MIN_MEMORY=512' \
49+
-e 'ACTIVEMQ_MAX_MEMORY=2048'
50+
51+
```
52+
This sample lauch ActiveMQ in docker with 512 MB of memory, and then ACtiveMQ can take 2048 MB of max memory
53+
4454
## Storage
4555

4656
The necessary hard drive space depends if you use persistant message or not and the type of appender. Normaly, no need space for ActiveMQ because the most data are contains directly on memory.
@@ -174,6 +184,8 @@ Below is the complete list of available options that can be used to customize yo
174184
- **ACTIVEMQ_TEMP_USAGE**: The maximum amount of space temp the broker will use before disabling caching and/or slowing down producers. Default to `50 gb`
175185
- **ACTIVEMQ_MAX_CONNECTION**: It's DOS protection. It limit concurrent connections. Default to `1000`
176186
- **ACTIVEMQ_FRAME_SIZE**: It's DOS protection. It limit the frame size. Default to `104857600` (100MB)
187+
- **ACTIVEMQ_MIN_MEMORY**: The init memory in MB that ActiveMQ take when start (it's like XMS). Default to `128` (128 MB)
188+
- **ACTIVEMQ_MAX_MEMORY**: The max memory in MB that ActiveMQ can take (it's like XMX). Default to `1024` (1024 MB)
177189

178190
- **ACTIVEMQ_ADMIN_LOGIN**: The login for admin account (broker and web console). Default to `admin`
179191
- **ACTIVEMQ_ADMIN_PASSWORD**: The password for admin account. Default to `admin`

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.10.05.10.05.10.05.10.05.10.0
1+
5.10.0

assets/bin/wrapper.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,10 @@ wrapper.java.additional.12=-Djava.security.auth.login.config=%ACTIVEMQ_CONF%/log
7171
#wrapper.java.additional.n=-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=5005
7272

7373
# Initial Java Heap Size (in MB)
74-
#wrapper.java.initmemory=3
74+
wrapper.java.initmemory={{ACTIVEMQ_MIN_MEMORY}}}
7575

7676
# Maximum Java Heap Size (in MB)
77-
wrapper.java.maxmemory=1024
77+
wrapper.java.maxmemory={{ACTIVEMQ_MAX_MEMORY}}
7878

7979
# Application parameters. Add parameters as needed starting from 1
8080
wrapper.app.parameter.1=org.apache.activemq.console.Main

assets/init

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ ACTIVEMQ_STORAGE_USAGE=${ACTIVEMQ_STORAGE_USAGE:-"100 gb"}
1717
ACTIVEMQ_TEMP_USAGE=${ACTIVEMQ_TEMP_USAGE:-"50 gb"}
1818
ACTIVEMQ_MAX_CONNECTION=${ACTIVEMQ_MAX_CONNECTION:-1000}
1919
ACTIVEMQ_FRAME_SIZE=${ACTIVEMQ_FRAME_SIZE:-104857600}
20-
20+
ACTIVEMQ_MIN_MEMORY=${ACTIVEMQ_MIN_MEMORY:-128}
21+
ACTIVEMQ_MAX_MEMORY=${ACTIVEMQ_MAX_MEMORY:-1024}
2122

2223
# Users settings
2324
ACTIVEMQ_ADMIN_LOGIN=${ACTIVEMQ_ADMIN_LOGIN:-admin}
@@ -111,7 +112,11 @@ else
111112
sudo -u activemq -H sed 's/{{ACTIVEMQ_PERSISTENT_DESTINATION}}/'""'/' -i conf/activemq.xml
112113
fi
113114

115+
# We setting the wrapper.conf file (this is the main setting of wrapper)
116+
sudo -u activemq -H sed 's/{{ACTIVEMQ_MIN_MEMORY}}/'"${ACTIVEMQ_MIN_MEMORY}"'/' -i bin/linux-x86-64/wrapper.conf
117+
sudo -u activemq -H sed 's/{{ACTIVEMQ_MAX_MEMORY}}/'"${ACTIVEMQ_MAX_MEMORY}"'/' -i bin/linux-x86-64/wrapper.conf
114118

119+
# We fix some problem about right
115120
chown -R activemq:activemq ${ACTIVEMQ_DATA}
116121
chown -R activemq:activemq ${ACTIVEMQ_LOG}
117122
chown -R activemq:activemq ${ACTIVEMQ_CONF}

0 commit comments

Comments
 (0)