mirror of https://github.com/apache/activemq.git
simplify default config, remove vmcursor refs and default memory limits to 70% heap. hardcoded default 1g
This commit is contained in:
parent
211f566b54
commit
5bdcc19693
|
@ -1038,10 +1038,10 @@ public class BrokerService implements Service {
|
||||||
|
|
||||||
systemUsage = new SystemUsage("Main", getPersistenceAdapter(), getTempDataStore(), getJobSchedulerStore());
|
systemUsage = new SystemUsage("Main", getPersistenceAdapter(), getTempDataStore(), getJobSchedulerStore());
|
||||||
systemUsage.setExecutor(getExecutor());
|
systemUsage.setExecutor(getExecutor());
|
||||||
systemUsage.getMemoryUsage().setLimit(1024 * 1024 * 64); // 64 MB
|
systemUsage.getMemoryUsage().setLimit(1024L * 1024 * 1024 * 1); // 1 GB
|
||||||
systemUsage.getTempUsage().setLimit(1024L * 1024 * 1024 * 50); // 50 GB
|
systemUsage.getTempUsage().setLimit(1024L * 1024 * 1024 * 50); // 50 GB
|
||||||
systemUsage.getStoreUsage().setLimit(1024L * 1024 * 1024 * 100); // 100 GB
|
systemUsage.getStoreUsage().setLimit(1024L * 1024 * 1024 * 100); // 100 GB
|
||||||
systemUsage.getJobSchedulerUsage().setLimit(1024L * 1024 * 1000 * 50); // 50 // Gb
|
systemUsage.getJobSchedulerUsage().setLimit(1024L * 1024 * 1024 * 50); // 50 GB
|
||||||
addService(this.systemUsage);
|
addService(this.systemUsage);
|
||||||
}
|
}
|
||||||
return systemUsage;
|
return systemUsage;
|
||||||
|
@ -1888,10 +1888,10 @@ public class BrokerService implements Service {
|
||||||
long jvmLimit = Runtime.getRuntime().maxMemory();
|
long jvmLimit = Runtime.getRuntime().maxMemory();
|
||||||
|
|
||||||
if (memLimit > jvmLimit) {
|
if (memLimit > jvmLimit) {
|
||||||
|
usage.getMemoryUsage().setPercentOfJvmHeap(70);
|
||||||
LOG.error("Memory Usage for the Broker (" + memLimit / (1024 * 1024) +
|
LOG.error("Memory Usage for the Broker (" + memLimit / (1024 * 1024) +
|
||||||
" mb) is more than the maximum available for the JVM: " +
|
" mb) is more than the maximum available for the JVM: " +
|
||||||
jvmLimit / (1024 * 1024) + " mb - resetting to maximum available: " + jvmLimit / (1024 * 1024) + " mb");
|
jvmLimit / (1024 * 1024) + " mb - resetting to 70% of maximum available: " + (usage.getMemoryUsage().getLimit() / (1024 * 1024)) + " mb");
|
||||||
usage.getMemoryUsage().setLimit(jvmLimit);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getPersistenceAdapter() != null) {
|
if (getPersistenceAdapter() != null) {
|
||||||
|
|
|
@ -19,7 +19,6 @@
|
||||||
|
|
||||||
<beans
|
<beans
|
||||||
xmlns="http://www.springframework.org/schema/beans"
|
xmlns="http://www.springframework.org/schema/beans"
|
||||||
xmlns:amq="http://activemq.apache.org/schema/core"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd
|
||||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
|
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
|
||||||
|
@ -33,13 +32,11 @@
|
||||||
<destinationPolicy>
|
<destinationPolicy>
|
||||||
<policyMap>
|
<policyMap>
|
||||||
<policyEntries>
|
<policyEntries>
|
||||||
<policyEntry topic=">" producerFlowControl="true">
|
<policyEntry topic=">" >
|
||||||
<pendingMessageLimitStrategy>
|
<pendingMessageLimitStrategy>
|
||||||
<constantPendingMessageLimitStrategy limit="1000"/>
|
<constantPendingMessageLimitStrategy limit="1000"/>
|
||||||
</pendingMessageLimitStrategy>
|
</pendingMessageLimitStrategy>
|
||||||
</policyEntry>
|
</policyEntry>
|
||||||
<policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb">
|
|
||||||
</policyEntry>
|
|
||||||
</policyEntries>
|
</policyEntries>
|
||||||
</policyMap>
|
</policyMap>
|
||||||
</destinationPolicy>
|
</destinationPolicy>
|
||||||
|
@ -59,7 +56,7 @@
|
||||||
<systemUsage>
|
<systemUsage>
|
||||||
<systemUsage>
|
<systemUsage>
|
||||||
<memoryUsage>
|
<memoryUsage>
|
||||||
<memoryUsage limit="64 mb"/>
|
<memoryUsage percentOfJvmHeap="70"/>
|
||||||
</memoryUsage>
|
</memoryUsage>
|
||||||
<storeUsage>
|
<storeUsage>
|
||||||
<storeUsage limit="100 gb"/>
|
<storeUsage limit="100 gb"/>
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
<!-- START SNIPPET: example -->
|
<!-- START SNIPPET: example -->
|
||||||
<beans
|
<beans
|
||||||
xmlns="http://www.springframework.org/schema/beans"
|
xmlns="http://www.springframework.org/schema/beans"
|
||||||
xmlns:amq="http://activemq.apache.org/schema/core"
|
|
||||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
|
||||||
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
|
http://activemq.apache.org/schema/core http://activemq.apache.org/schema/core/activemq-core.xsd">
|
||||||
|
@ -40,21 +39,10 @@
|
||||||
-->
|
-->
|
||||||
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">
|
<broker xmlns="http://activemq.apache.org/schema/core" brokerName="localhost" dataDirectory="${activemq.data}">
|
||||||
|
|
||||||
<!--
|
|
||||||
For better performances use VM cursor and small memory limit.
|
|
||||||
For more information, see:
|
|
||||||
|
|
||||||
http://activemq.apache.org/message-cursors.html
|
|
||||||
|
|
||||||
Also, if your producer is "hanging", it's probably due to producer flow control.
|
|
||||||
For more information, see:
|
|
||||||
http://activemq.apache.org/producer-flow-control.html
|
|
||||||
-->
|
|
||||||
|
|
||||||
<destinationPolicy>
|
<destinationPolicy>
|
||||||
<policyMap>
|
<policyMap>
|
||||||
<policyEntries>
|
<policyEntries>
|
||||||
<policyEntry topic=">" producerFlowControl="true">
|
<policyEntry topic=">" >
|
||||||
<!-- The constantPendingMessageLimitStrategy is used to prevent
|
<!-- The constantPendingMessageLimitStrategy is used to prevent
|
||||||
slow topic consumers to block producers and affect other consumers
|
slow topic consumers to block producers and affect other consumers
|
||||||
by limiting the number of messages that are retained
|
by limiting the number of messages that are retained
|
||||||
|
@ -67,17 +55,6 @@
|
||||||
<constantPendingMessageLimitStrategy limit="1000"/>
|
<constantPendingMessageLimitStrategy limit="1000"/>
|
||||||
</pendingMessageLimitStrategy>
|
</pendingMessageLimitStrategy>
|
||||||
</policyEntry>
|
</policyEntry>
|
||||||
<policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb">
|
|
||||||
<!-- Use VM cursor for better latency
|
|
||||||
For more information, see:
|
|
||||||
|
|
||||||
http://activemq.apache.org/message-cursors.html
|
|
||||||
|
|
||||||
<pendingQueuePolicy>
|
|
||||||
<vmQueueCursor/>
|
|
||||||
</pendingQueuePolicy>
|
|
||||||
-->
|
|
||||||
</policyEntry>
|
|
||||||
</policyEntries>
|
</policyEntries>
|
||||||
</policyMap>
|
</policyMap>
|
||||||
</destinationPolicy>
|
</destinationPolicy>
|
||||||
|
@ -108,28 +85,13 @@
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
The systemUsage controls the maximum amount of space the broker will
|
The systemUsage controls the maximum amount of space the broker will
|
||||||
use before slowing down producers. For more information, see:
|
use before disabling caching and/or slowing down producers. For more information, see:
|
||||||
http://activemq.apache.org/producer-flow-control.html
|
http://activemq.apache.org/producer-flow-control.html
|
||||||
If using ActiveMQ embedded - the following limits could safely be used:
|
-->
|
||||||
|
|
||||||
<systemUsage>
|
|
||||||
<systemUsage>
|
|
||||||
<memoryUsage>
|
|
||||||
<memoryUsage limit="20 mb"/>
|
|
||||||
</memoryUsage>
|
|
||||||
<storeUsage>
|
|
||||||
<storeUsage limit="1 gb"/>
|
|
||||||
</storeUsage>
|
|
||||||
<tempUsage>
|
|
||||||
<tempUsage limit="100 mb"/>
|
|
||||||
</tempUsage>
|
|
||||||
</systemUsage>
|
|
||||||
</systemUsage>
|
|
||||||
-->
|
|
||||||
<systemUsage>
|
<systemUsage>
|
||||||
<systemUsage>
|
<systemUsage>
|
||||||
<memoryUsage>
|
<memoryUsage>
|
||||||
<memoryUsage limit="64 mb"/>
|
<memoryUsage percentOfJvmHeap="70" />
|
||||||
</memoryUsage>
|
</memoryUsage>
|
||||||
<storeUsage>
|
<storeUsage>
|
||||||
<storeUsage limit="100 gb"/>
|
<storeUsage limit="100 gb"/>
|
||||||
|
|
Loading…
Reference in New Issue