Home PC Games Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ ActiveMQ memory settings and flow control     - MySQL query performance comparison of a single truth (Database)

- File encryption and decryption of Linux security mechanisms (Linux)

- Ubuntu 14.04 Install WordPress on Nginx (Server)

- How to install Linux Kernel 4.0 On CentOS 7 system (Linux)

- CentOS 6.5 installation and simple configuration Nginx (Server)

- Laravel configuration PhpStorm + Xdebug + Chrome settings Debug Environment (Server)

- Install Java on RHEL6 (Linux)

- Linux firewall to prevent external network attacks (Linux)

- Oracle SDE and maintain common commands - Display space (Database)

- MongoDB relations, references, index query coverage (Database)

- High-performance JavaScript reflows and repaints (Programming)

- Ceph distributed storage system is installed on a CentOS 7.1 (Server)

- Ubuntu Server security risk checks (Linux)

- Linux and hardware (Linux)

- DRBD daily management (Server)

- Update GAMIT10.6 command (Linux)

- How to find on Linux and delete duplicate files: FSlint (Linux)

- Lambda expressions of evolution (Programming)

- Eclipse distributed management using GitHub project development (Linux)

- Linux Regular expressions grep and egrep (Linux)

  ActiveMQ memory settings and flow control
  Add Date : 2018-11-21      
  Startup script to set jvm memory

if "% ACTIVEMQ_OPTS%" == "" set ACTIVEMQ_OPTS = -Xms1G-Xmx1G -Djava.util.logging.config.file = logging.properties

The amount of system memory and disk space usage broker configuration

        < SystemUsage>

            < SystemUsage>

                < MemoryUsage>

                    < MemoryUsagelimit = "64 mb" />

                < / MemoryUsage>

                < StoreUsage>

                    < StoreUsagelimit = "100 gb" />

                < / StoreUsage>

                < TempUsage>

                    < TempUsagelimit = "50 gb" />

                < / TempUsage>

            < / SystemUsage>

        < / SystemUsage>

If it is embedded (embedded) manner, it can be added to new a SystemUsage BrokerService go. MemoryUsage configured here must be less than the number jvm set.

5.9.0 version, memoryUsagelimit If greater than the actual value of the available java heap size, such as the default start xmx = 1G, then the actual java heap size is about 910M,

When the broker starts up log.error prompted to set the memory error, and then forced to use actual java heap size * 70% = 637M as memoryUsagelimit.

splitSystemUsageForProducersConsumers not even lead to slow consumer spending problem

In fact, broker can also be configured individually consumerSystemUsage producerSystemUsage producers and consumers to use use the same format with systeUsage.

By default, no producerSystemUsage and consumerSystemUsage, the producers and consumers to use systemUsage.

Then it may be because the producer thread runs out of memory, leading consumers to threading issues can not even slow consumption. In this case, add the consumption side of the machine and the number of consumers might not increase the rate of consumption.

The solution is:

Setting splitSystemUsageForProducersConsumers on broker = "true", so that the producer and consumer threads each thread using each memory.

The default is the producer thread Memory: Memory consumer thread = 6: 4.

You may be provided by the following two parameters for each half of the producer and consumer threads thread memory Memory:

producerSystemUsagePortion = 50

consumerSystemUsagePortion = 50

Producer flow control

Starting from version 5.x, you can set the flow control to each producer individually. Flow control simply means that control the behavior of producers in the memory usage limits. Of course, the flow control aims to prevent the MQ explode when used as ActiveMQ when the memory MQ, the production rate is greater than the rate of consumption issues.

In two cases:

1, send a message synchronously (useAsynSend to false): The under SystemUsage limited use destinationPolicy the policyEntry of restrictions, such as:

< DestinationPolicy>

  < PolicyMap>

    < PolicyEntries>

      < PolicyEntry queue = "queueA" producerFlowControl = "true" memoryLimit = "1mb">

  < PendingQueuePolicy>

    < VmQueueCursor />

  < / PendingQueuePolicy>

< / PolicyEntry>

    < / PolicyEntries>

  < / PolicyMap>

< / DestinationPolicy>

When the memory usage limit for non-persistent queueA 1mb, directly blocking out producer reached the amount of memory used until a spare memory, the producer is allowed to send a message.

Also by setting sendFailIfNoSpace on systemUsage Configuration = "true" or sendFailIfNoSpaceAfterTimeout = "3000" to control the client and abnormal latency.

Asynchronous transmission because they do not clog producers,

By connctionFactory.setProducerWindowSize (1024000);

To control the maximum amount of data broker confirmation (byte) before receiving the message producer can send.

Consumer Flow Control

Consumer side, the sooner the better general consumption, broker backlog as small as possible.

However, taking into account the transaction and confirm the client, if a consumer to get a lot of information but do not confirm, this transaction will result in larger context, broker end of this "half-consumption status" of data increases, so ActiveMQ there is a parameter to control prefetchSize unconfirmed case, the maximum number of records to prefetch.

By default, as follows:

Persistent queue: 1000 Tiao

Non-persistent queue: 1000 Tiao

Persistence topic: 100 Tiao

Non-persistent topic: Unlimited

You can set prefetchSize way through 3

1, tcp: // localhost:? 61616 jms.prefetchPolicy.all = 50

2, tcp: // localhost: 61616 jms.prefetchPolicy.queuePrefetch = 1?

3, queue = new ActiveMQQueue ( "TEST.QUEUE consumer.prefetchSize = 10?");
- CentOS 6.5 installation Python3.0 (Linux)
- For the FreeBSD install Adobe Flash plug-in (Linux)
- Use mysqldump backup performed MariaDB (Database)
- Smooth upgrade to OpenSSH 6.1 Procedure (Linux)
- Oracle 11G R2 DataGuard structures (Database)
- JavaScript common array manipulation functions and usage (Programming)
- C ++ 11 feature: auto keyword (Programming)
- Linux C programming and Shell Programming in the development of practical tools similarities summary (Programming)
- Use install_updates upgrade GAMIT / GLOBK (Linux)
- The most common and most effective security settings under linux (Linux)
- How to download video youtube-dl in Linux (Linux)
- 24 Docker recommendations (Linux)
- 20 Top Linux commands (Linux)
- Git uses a standard process (Linux)
- Remove old kernel on Ubuntu (Linux)
- Hibernate Search and Lucene quick introduction (Linux)
- RHEL6.5 replace local YUM source (Linux)
- Android source code compiled fatal error solutions (Programming)
- Using Java program determines whether it is a leap year (Programming)
- Log4Net (Linux)
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.