13.5 小结

博客已搬家, 更好阅读体验, 猛戳 http://www.jack-yin.com/coding/translation/activemq-in-action/1808.html

 

13.5 Summary

13.5 小结

 

In general, message performance can be  improved by asking ActiveMQ to do  less.

Consider the overhead of persisting  messages and the cost of  transporting both

messages and  client acknowledgments  over the  wire. If  possible, use reliable

messaging or  batching of  messages in  transactions to  reduce the  overhead of

passing  a receipt  from the  broker to  the producer  that it  has received  a

message. You can reduce the amount  of work the ActiveMQ broker does  by setting

suitable  memory limits  (more is  better) and  deciding whether  producer flow

control is suitable for your application. The message consumer has to work twice

as hard as the message  producer, so optimizing delivery with  a MessageListener

and using  straight-through message  processing together  with an acknowledgment

mode or transactions  that allow acknowledgments  to be batched  can reduce this

load.

 

通常,可以通过减少ActiveMQ的一些额外操作来改善消息程序的性能.由持久化消息而代理的

额外开销以及通过网络传输消息和客户端的消息确认带来的开销即可见一斑.如果可能的话,

使用可靠消息或者使用事务来进行消息分区,以便减少因代理传递消息回执给消息生产者告知

代理已经收到消息了而代来的额外开销.你可以设置适合的内存限制(越多越好)以及确定

消息生产者流控制是否适合你的程序,从而减少ActiveMQ代理要做的工作.消息消费者的工作量

是消息生产者的2倍,因而使用MessageListener来优化消息分发同时设置合适消息确认模式或

使用事务来批量发送消息确认从而使用直通消息处理模式可以减轻消息消费者的负担.

 

............................

 

博客已搬家, 更好阅读体验, 猛戳 http://www.jack-yin.com/coding/translation/activemq-in-action/1808.html

你可能感兴趣的:(activemq,性能调优)