Return-Path: Delivered-To: apmail-geronimo-activemq-dev-archive@www.apache.org Received: (qmail 78666 invoked from network); 27 Apr 2006 19:59:03 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 27 Apr 2006 19:59:03 -0000 Received: (qmail 68269 invoked by uid 500); 27 Apr 2006 19:59:02 -0000 Delivered-To: apmail-geronimo-activemq-dev-archive@geronimo.apache.org Received: (qmail 68228 invoked by uid 500); 27 Apr 2006 19:59:02 -0000 Mailing-List: contact activemq-dev-help@geronimo.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: activemq-dev@geronimo.apache.org Delivered-To: mailing list activemq-dev@geronimo.apache.org Received: (qmail 68217 invoked by uid 99); 27 Apr 2006 19:59:02 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Apr 2006 12:59:02 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [209.237.227.198] (HELO brutus.apache.org) (209.237.227.198) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Apr 2006 12:59:01 -0700 Received: from brutus (localhost [127.0.0.1]) by brutus.apache.org (Postfix) with ESMTP id A68BF41000D for ; Thu, 27 Apr 2006 19:58:37 +0000 (GMT) Message-ID: <9254055.1146167917678.JavaMail.jira@brutus> Date: Thu, 27 Apr 2006 19:58:37 +0000 (GMT+00:00) From: "Christopher A. Larrieu (JIRA)" To: activemq-dev@geronimo.apache.org Subject: [jira] Commented: (AMQ-688) Avoid blocking producers In-Reply-To: <1588956545.1144694032207.JavaMail.jira@ajax> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N [ https://issues.apache.org/activemq/browse/AMQ-688?page=comments#action_36103 ] Christopher A. Larrieu commented on AMQ-688: -------------------------------------------- How can we collaborate on this work? The described functionality is crucial to ActiveMQ's success within our organization. > Avoid blocking producers > ------------------------ > > Key: AMQ-688 > URL: https://issues.apache.org/activemq/browse/AMQ-688 > Project: ActiveMQ > Type: New Feature > Components: Broker > Versions: 4.0 RC 2 > Reporter: Christopher A. Larrieu > Assignee: Christopher A. Larrieu > Fix For: incubation > > Original Estimate: 8 weeks > Remaining: 8 weeks > > Our main goal > is to avoid stalled producers by addressing the main culprit: too many undispatched messages > in the broker's memory. Our motivation is to handle significant --though temporary-- imbalances > between production and consumption rates. > Reaching this goal entails specific broker modifications: > 1. When memory gets tight, start dropping undispatched non-persistent messages. This is the > first-cut attempt to maintain throughput of persistent messages. > Unlike the approach documented at http://docs.codehaus.org/display/ACTIVEMQ/Slow+Consumer+Handling, > the message dropping will only occur after the UsageManager reaches capacity. Non-persistent > messages in dispatch lists will be dropped according to per-destination policy. Subscriptions > can purge their own messages triggered via callback from the UsageManager. > 2. Evict messages if memory remains tight, to be fetched from backing store prior to dispatch. > ActiveMQ already supports this for persistent messages on Topics with durable subscriptions. > If a consumer's prefetch buffer is full, the splash-over messages remain as IndirectMessageReference > objects in the dispatch list, with the actual message body loaded from store on demand. I > believe we can extend this approach for Queues as well. > 3. Improve the efficiency with which evicted messages are loaded back into memory. > Currently, they are loaded one at a time as needed. It would make sense to batch-load message > sets periodically. This will require a significant shift in responsibilities between objects, > since an IndirectMessageReference doesn't know about other instances that can be loaded in > mass. > > The goal will be to keep each subscription dispatch list stocked with a decent number of messages > in-memory to reasonably trade-off between it's consumer's performance and resource usage in > the broker. As with everything else, we can implement this as a strategy class with the first > cut implementing a simple resource allocation strategy: divvy up available memory amongst > all subscriptions and keep that memory filled with messages for dispatch. I envision a worker > task assuming responsibility for keeping these lists filled. > 4. Even with the above modifications, we still can't entirely avoid blocked producers, so > we'd like to add client-configurable time-outs to provide a bound for the time a producer > can remain stalled. > Maybe this should be a new attribute of ActiveMQConnection: maxProducerFlowControlWait. Calls > to UsageManager.waitForSpace can take this quantity as an argument. Failure to reach sufficient > space for the new message will throw an exception back up the stack and across the wire, letting > the producer know that the message was not delivered. > 5. Finally, we need to extend disk support for Topics that have only non-durable subscribers, > otherwise their dispatch lists can fill up with persistent messages. In order to maintain > compliance with JMS, it would be nice to provide some alternative to dropping persistent messages. > One possible first cut is to layer this on top of a DurableTopicSubscription by creating an > anonymous subscriber for every Topic that has only non-durable subscriptions. When all such > subscriptions terminate, the broker can remove the anonymous subscriber. -- This message is automatically generated by JIRA. - If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/activemq/secure/Administrators.jspa - For more information on JIRA, see: http://www.atlassian.com/software/jira