Hi Bilgin
See inilne...

On Fri, Jan 24, 2014 at 5:29 AM, Bilgin Ibryam <bibr...@gmail.com> wrote:
> Hi all,
>
> I have couple of questions regarding memory configurations. I read the docs
> and couple of blog posts, but still cannot figure it out completely.
>
> In my case I have only persistent queues.
>
> 1. For memoryUsage, the docs say: "for non-persistent messages, specifies
> the maximum amount of memory used to hold the messages." Does it applies in
> anyway for persistent messages too or to whole broker memory used too? Or
> is it only for non-persistent as the docs suggests?
Persistent messages that are cached in the broker when using
StoreCursor do count against the memory limit. These messages are
cached with the assumption that they are about to be dispatched to
consumers and its faster to pull from memory than pull directly from
disk to do the dispatch. By default, the highWaterMark set for these
cursors is 70%. So until 70% of memory of the queue is used, it will
continue to cache messages.

>
> 2. For persistent messages, I have memoryLimit set per destination basis.
> Do I need to consider what is the memoryUsage set in this case? I mean is
> there any relation between memoryUsage and memoryLimit, like memoryUsage >=
> memoryLimit x number_of_queues
>
Yes, the relationship you noted is more or less correct. If you
specify X for a system wide limits  and you have N queues, then you
want to keep the sum of N queues' memory limits lower than overall
system limits.

> 3. If I have 3gb for the broker JVM, can I assume it is safe to use 70% of
> that for the queues, for example by giving 200mb per destination in total
> for 10 queues. And leave the remaining 30% (1gb) for the broker
> threads/consumers and so on.
This is probably okay, but there are no hard and fast rules on this
part. Just depends on threads, objects, are you running anything else
in the JVM, etc, etc.

>
> Thanks
>
>
>
> --
> Bilgin Ibryam
>
> Apache Camel & Apache OFBiz committer
> Blog: ofbizian.com
> Twitter: @bibryam <https://twitter.com/bibryam>
>
> Author of Instant Apache Camel Message Routing
> http://www.amazon.com/dp/1783283475



-- 
Christian Posta
http://www.christianposta.com/blog
twitter: @christianposta

Reply via email to