简体   繁体   English

activemq性能问题和预防措施

[英]activemq performance gotchas and precautions

I am going to use ActiveMQ for the first time in one of my projects (topics for durable messages). 我将在我的一个项目中首次使用ActiveMQ(持久消息的主题)。 I have read that durable messages enforce a limit to the scale of number of messages per second. 我已经读过,持久消息强制限制每秒的消息数量级。 What are the other factors that I should be aware of (eg slow consumers) that puts a limit to the scale and performance characteristics of activemq and what metrics should be closely monitored and what are the values at which all hell breaks lose. 我应该注意哪些其他因素(例如缓慢的消费者)限制了activemq的规模和性能特征以及应该密切监控哪些指标以及所有地狱破坏的价值是什么。

I don't expect to be pushing more than a thousand events per second in ActiveMQ for now. 我不希望现在在ActiveMQ中每秒推动超过一千个事件。

here are a few tips... 这里有一些提示......

  • increase your systemUsage limits from the defaults 从默认值增加systemUsage限制
  • increase your JVM heap size from the defaults 从默认值增加JVM堆大小
  • if using KahaDB , consider setting enableJournalDiskSyncs to false (helps throughput dramatically) or preferably use the new LevelDB 如果使用KahaDB ,请考虑将enableJournalDiskSyncs设置为false(有助于显着提高吞吐量)或最好使用新的LevelDB
  • learn about producer flow control and consider disabling (frequently done) 了解生产者流程控制并考虑禁用(经常完成)
  • consider using virtual topics (instead of durable topic consumers) 考虑使用虚拟主题 (而不是持久主题消费者)
  • learn about prefetch-limit and tweak as needed 了解prefetch-limit和根据需要进行调整

Two specific issues I ran into with activeMQ: 我在activeMQ中遇到的两个具体问题:

1) There are memory limits enforced per queue that need to be tuned. 1)每个队列都需要调整内存限制。 ActiveMQ won't fill up your heap unless you change the config. 除非您更改配置,否则ActiveMQ不会填满您的堆。 So you need to set -Xmx and change the config to use more memory. 因此,您需要设置-Xmx并更改配置以使用更多内存。

2) Related to #1, by default the sender (client) blocks when limits are reached. 2)与#1相关,默认情况下, 发送方 (客户端)在达到限制时阻止。 In newer versions, there is a setting to avoid this and have an exception thrown instead. 在较新的版本中,有一个设置可以避免这种情况,而是抛出异常。 See http://activemq.apache.org/producer-flow-control.html . 请参见http://activemq.apache.org/producer-flow-control.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM