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.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.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);
|
||||
}
|
||||
return systemUsage;
|
||||
|
@ -1888,10 +1888,10 @@ public class BrokerService implements Service {
|
|||
long jvmLimit = Runtime.getRuntime().maxMemory();
|
||||
|
||||
if (memLimit > jvmLimit) {
|
||||
usage.getMemoryUsage().setPercentOfJvmHeap(70);
|
||||
LOG.error("Memory Usage for the Broker (" + memLimit / (1024 * 1024) +
|
||||
" mb) is more than the maximum available for the JVM: " +
|
||||
jvmLimit / (1024 * 1024) + " mb - resetting to maximum available: " + jvmLimit / (1024 * 1024) + " mb");
|
||||
usage.getMemoryUsage().setLimit(jvmLimit);
|
||||
jvmLimit / (1024 * 1024) + " mb - resetting to 70% of maximum available: " + (usage.getMemoryUsage().getLimit() / (1024 * 1024)) + " mb");
|
||||
}
|
||||
|
||||
if (getPersistenceAdapter() != null) {
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
|
||||
<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"
|
||||
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">
|
||||
|
@ -33,13 +32,11 @@
|
|||
<destinationPolicy>
|
||||
<policyMap>
|
||||
<policyEntries>
|
||||
<policyEntry topic=">" producerFlowControl="true">
|
||||
<policyEntry topic=">" >
|
||||
<pendingMessageLimitStrategy>
|
||||
<constantPendingMessageLimitStrategy limit="1000"/>
|
||||
</pendingMessageLimitStrategy>
|
||||
</policyEntry>
|
||||
<policyEntry queue=">" producerFlowControl="true" memoryLimit="1mb">
|
||||
</policyEntry>
|
||||
</policyEntries>
|
||||
</policyMap>
|
||||
</destinationPolicy>
|
||||
|
@ -59,7 +56,7 @@
|
|||
<systemUsage>
|
||||
<systemUsage>
|
||||
<memoryUsage>
|
||||
<memoryUsage limit="64 mb"/>
|
||||
<memoryUsage percentOfJvmHeap="70"/>
|
||||
</memoryUsage>
|
||||
<storeUsage>
|
||||
<storeUsage limit="100 gb"/>
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
<!-- START SNIPPET: example -->
|
||||
<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"
|
||||
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">
|
||||
|
@ -40,21 +39,10 @@
|
|||
-->
|
||||
<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>
|
||||
<policyMap>
|
||||
<policyEntries>
|
||||
<policyEntry topic=">" producerFlowControl="true">
|
||||
<policyEntry topic=">" >
|
||||
<!-- The constantPendingMessageLimitStrategy is used to prevent
|
||||
slow topic consumers to block producers and affect other consumers
|
||||
by limiting the number of messages that are retained
|
||||
|
@ -67,17 +55,6 @@
|
|||
<constantPendingMessageLimitStrategy limit="1000"/>
|
||||
</pendingMessageLimitStrategy>
|
||||
</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>
|
||||
</policyMap>
|
||||
</destinationPolicy>
|
||||
|
@ -108,28 +85,13 @@
|
|||
|
||||
<!--
|
||||
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
|
||||
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>
|
||||
<memoryUsage>
|
||||
<memoryUsage limit="64 mb"/>
|
||||
<memoryUsage percentOfJvmHeap="70" />
|
||||
</memoryUsage>
|
||||
<storeUsage>
|
||||
<storeUsage limit="100 gb"/>
|
||||
|
|
Loading…
Reference in New Issue