Return-Path: Delivered-To: apmail-geronimo-activemq-dev-archive@www.apache.org Received: (qmail 63342 invoked from network); 10 Apr 2006 18:34:16 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 10 Apr 2006 18:34:16 -0000 Received: (qmail 39411 invoked by uid 500); 10 Apr 2006 18:34:15 -0000 Delivered-To: apmail-geronimo-activemq-dev-archive@geronimo.apache.org Received: (qmail 39386 invoked by uid 500); 10 Apr 2006 18:34:15 -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 39377 invoked by uid 99); 10 Apr 2006 18:34:15 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Apr 2006 11:34:15 -0700 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests= X-Spam-Check-By: apache.org Received: from [192.87.106.226] (HELO ajax.apache.org) (192.87.106.226) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 10 Apr 2006 11:34:13 -0700 Received: from ajax (localhost.localdomain [127.0.0.1]) by ajax.apache.org (Postfix) with ESMTP id 33A10D49FF for ; Mon, 10 Apr 2006 19:33:52 +0100 (BST) Message-ID: <1588956545.1144694032207.JavaMail.jira@ajax> Date: Mon, 10 Apr 2006 19:33:52 +0100 (BST) From: "Christopher A. Larrieu (JIRA)" To: activemq-dev@geronimo.apache.org Subject: [jira] Created: (AMQ-688) Avoid blocking producers 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 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 Fix For: incubation 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