activemq performance gotchas and precautions
I am going to use ActiveMQ for the first time in one of my projects (topics for durable messages). 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 (e.g. 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.
I don't expect to be pushing more than a thousand events per second i开发者_如何学Pythonn ActiveMQ for now.
here are a few tips...
- increase your systemUsage limits from the defaults
- increase your JVM heap size from the defaults
- if using KahaDB, consider setting enableJournalDiskSyncs to false (helps throughput dramatically) or preferably use the new 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
Two specific issues I ran into with activeMQ:
1) There are memory limits enforced per queue that need to be tuned. ActiveMQ won't fill up your heap unless you change the config. So you need to set -Xmx
and change the config to use more memory.
2) Related to #1, by default the sender (client) blocks when limits are reached. 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.
精彩评论