You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Jerome Banks <je...@gmail.com> on 2007/02/13 23:14:15 UTC

What does the UsageManager actually measure??

 This may seem like a strange question, but what does the ActiveMQ
MemoryManager class actually do, or what is the usage that it tries to
manage?

We have a Lingo application which might get swamped with requests under
certain circumstances.  This causes the request queue lengths to grow quite
large.  The service threads can ultimately process these requests, but it
can take a long time, and our clients end up all timing out. (One way around
this might be making our services @OneWay, but unfortunately that requires
extensive refactoring of our application)

   We'd like a situation where the broker would throw a runtime exception if
the request queue length grows too large. One way to do this, we thought
would be to limit the available memory used by the broker, by defining a
UsageManager for our broker, and setting the limit to a fairly small value
(64K). This however doesn't seem to do anything, however. From jconsole, we
can see that MemoryPercentageUsed is always 0, even if there are a large
number of large messages in the Lingo request queue.  (We also try to set
the memoryLimit on the PolicyEntry on the queue. That also seems to have no
effect).  We even set up  a custom UsageListener on the UsageManager. That
seems to be invoked every so often when requests come in, but percent used
just goes back and forth between 0 and 2 percent.

   Something seems to be measured, but it doesn't seem to be the total size
of objects in that queue.  What are doing wrong? Is there a simpler way to
limit the total number of messages in queue?

BTW , we're running ActiveMQ 4.0.2 with Lingo 1.3

thanks if anyone has any insight ...
 --- jerome