Performance degradation when using ActiveMQ Scheduler

In one of our projects, we suffer from ActiveMQ performance degradation when we use the schedule engine (including schedulerSupport in the ActiveMQ configuration) with a large number of messages (1M or more). The project is based on Spring, and we also use Camel for route management.

Our routes are configured as follows:

  • producer P creates 800 messages per second and sends them through an intermittent ActiveMQ Q queue
  • Cq consumer processes messages from Q according to the following rule: for each message, it checks whether the message can be processed immediately (each message has a time window attribute to determine this). If possible, Cq forwards the message to the Throttling T queue; if it is not, Cq forwards the messages to the S support queue
  • consumer Cs processes messages from S, and it sends the message according to its time window (setting the ActiveMQ property ScheduledMessage.AMQ_SCHEDULED_DELAYwith the following expression:) message.setLongProperty(ScheduledMessage.AMQ_SCHEDULED_DELAY, <delay>);, where it <delay>is evaluated according to time, the window
  • when a scheduled message wakes up from a scheduled ActiveMQ area, it is routed to the Throttling T queue
  • Ct consumer processes message from T using a third-party component (via TCP connection)

P (.. ), (1M ): , ( ).

P ( ), :

  • , (Q S), , S
  • , S, , T: (1K /)
  • , Q S, T ( 50 )
  • ( ) (, , P), - 50 ,

  • ActiveMQ: 5.9.0 ( 3 )
  • : 2.15.1
  • Spring : 4.1.3.RELEASE
  • 1 : 4.5KiB
  • :
    • Q → S ( ) → T
    • Q → T ( )
  • : 1 1 . / ( )
  • : 1M 50 /
  • , - : 2% 5% , (Java GC )
  • ( VMWare):
    • : 24 vCPU, 24 Intel (R) Xeon (R) CPU E5-2680 v3 @2.50
    • : 31744MB

,

+4
1

ActiveMQ 5.4 , ActiveMQ activemq.apache.org/delay-and-schedule-message-delivery.html

, , brokerURL ActiveMQConnectionFactory

:

ConnectionFactory connectionFactory = new ActiveMQConnectionFactory("tcp://localhost:61616?jms.copyMessageOnSend=false&jms.dispatchAsync=true&jms.useAsyncSend=true");

http://activemq.apache.org/connection-configuration-uri.html http://activemq.apache.org/performance-tuning.html

0

Source: https://habr.com/ru/post/1589157/


All Articles