A Closer Look at the Gigantic Destination Nut
I exposed the gigantic destination issues that ActiveMQ has in a previous blog post. I'll take a little time to expand on the issue and why it's not simple to solve, and what ActiveMQ 4.0 does today.
It's obvious that we need to swap messages to disk when a queue needs to hold more messages than it could hold in RAM. We sometimes also call that spooling messages to disk. The issues that make this hard to implement are:
This is a quick and dirty fix and it works, but it obviously does not fix all the issues outlined initial. The shortcomings of the current solution is that:
It's obvious that we need to swap messages to disk when a queue needs to hold more messages than it could hold in RAM. We sometimes also call that spooling messages to disk. The issues that make this hard to implement are:
- Writing a message to disk slows you down a little, avoid it if possible. Sometimes you have no choice if the message was marked a persistent.
- Sometimes we may need to swap out even non-persistent messages.
- Avoid chucking a message out of ram if possible since loading it back from disk is REALLY slow.
- When a consumer is ready to consume a message, that message should already be in memory, waiting for it to load from disk will lead to consumer starvation.
- Even keeping lists of message references to where messages are on disk can use up too much memory. 10,000,000 disk locations in a linked list where every node in the list used only 100 bytes would still chew up about 100 megs of memory.
This is a quick and dirty fix and it works, but it obviously does not fix all the issues outlined initial. The shortcomings of the current solution is that:
- it is only implemented for Queues
- consumer starvation problem can exist since it does not persisted load messages asynchronously
- it keeps a list of MessageReference objects which can still exhaust JVM memory

1 Comments:
I just started using AMQ. I was googling for AMQ large queue memory issue and found your blog, so this is not exactly comment but more a question/issue to share with you.
I think it's the memomy issue that my broker is unable to handle messages beyond 20MB. I tried to update config\activemq.xml
[usageManager id="memory-manager" limit="160 MB"]
but this also didn't work. Just wondering how can I increase the memory. I have about 120MB of data that I want to post in two queue. This 120 MB of data is actually 160 messages each less than 1MB size. I do have enough memory in my PC to handle it so not planing to go for persistance now. Any pointer will be great help.
By
Anonymous, At
10:38 AM
Post a Comment
<$I18N$LinksToThisPost>:
Create a Link
<< Home