activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tim Bain <tb...@alumni.duke.edu>
Subject Re: Disable flow control on certain consumers?
Date Sun, 26 Apr 2015 14:35:18 GMT
You may have figured this out in the past 3 weeks since you sent your first
note, but the answer to your question is that no, it's not currently
possible to enable PFC selectively, though there are a few tweaks you can
make individually.

PFC doesn't apply to consumers, so there is nothing you can set
per-consumer.

PFC can't be enabled/disabled on a per-destination basis (it's either on
for the entire broker and all destinations within it, or not), but you can
set per-destination limits at which it kicks in even if the broker as a
whole hasn't hit its limit.  By setting those limits for certain
destinations but not others, you can cause some of them to be PFC'ed
earlier and others not until the entire broker's memory store is full, but
all destinations will be PFC'ed when the broker's memory store is full.
There is no way to tell the broker to PFC certain destinations but allow
others to keep sending messages after the whole-broker memory store is full
(which presumably would lead to an OOM fairly quickly, so it's not clear
you'd want it anyway).  The closest you could come would be to set the
memory store limit equal to the JVM size and then set per-destination
limits on only some destinations; then your JVM would OOM before any of
your unrestricted destinations could be PFC'ed.  But again, I don't see why
you'd want to disable PFC, since OOMing your broker sounds like a bad thing
rather than a good thing.

Producers can be individually flow controlled - sort of - but I think the
wiki page you got your info from (
http://activemq.apache.org/producer-flow-control.html) is pretty
misleading.  The broker will kick in PFC at the same point no matter
whether per-producer PFC is enabled, but this means something different
than you think it does.  When the broker PFCs an individual destination,
any producers using per-producer PFC will block, because they're waiting
for an ack that won't come until PFC ends.  Any producers not using
per-producer PFC will continue sending blindly; when the broker receives
the next message from those producers, the broker will stop processing all
messages on that connection (because it's got nowhere to put the message
sent by the PFCed producer), including messages sent to destinations that
are not PFCed and acks sent by consumers using that connection.  (That can
lead to deadlocks, as referenced by the wiki page.)  Eventually the clients
on that connection will fill the broker's TCP receive buffer and the client
process's TCP send buffer, and they'll block on the send call - even though
they are nominally asynchronous.  So the result of disabling per-producer
PFC isn't actually to disable PFC for that producer; it does the opposite,
by ending up PFCing producers that shouldn't have been affected (as well as
consumers, who should never be affected by PFC).  Your consideration should
be whether to enable per-producer PFC on all producers instead of just the
default ones, not whether to disable it on all producers, which is why the
wiki has instructions on how to do the former but not the latter.

Tim

On Wed, Apr 1, 2015 at 8:32 PM, Kevin Burton <burton@spinn3r.com> wrote:

> I have some consumers that I want to disable flow control on , and others
> where I want it enabled .
>
> Is this possible?
>
> I was looking at how it was disabled by default on async unless you specify
> a window, but that seems like a hack to me and probably prone to some
> unknown issue I might run into.  Maybe I’m wrong of course.
>
> --
>
> Founder/CEO Spinn3r.com
> Location: *San Francisco, CA*
> blog: http://burtonator.wordpress.com
> … or check out my Google+ profile
> <https://plus.google.com/102718274791889610666/posts>
> <http://spinn3r.com>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message