Return-Path: Delivered-To: apmail-activemq-users-archive@www.apache.org Received: (qmail 93992 invoked from network); 27 May 2010 19:20:19 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 27 May 2010 19:20:19 -0000 Received: (qmail 63456 invoked by uid 500); 27 May 2010 19:20:19 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 63433 invoked by uid 500); 27 May 2010 19:20:19 -0000 Mailing-List: contact users-help@activemq.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@activemq.apache.org Delivered-To: mailing list users@activemq.apache.org Received: (qmail 63424 invoked by uid 99); 27 May 2010 19:20:19 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 May 2010 19:20:19 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,SPF_HELO_PASS,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of lists@nabble.com designates 216.139.236.158 as permitted sender) Received: from [216.139.236.158] (HELO kuber.nabble.com) (216.139.236.158) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 May 2010 19:20:14 +0000 Received: from isper.nabble.com ([192.168.236.156]) by kuber.nabble.com with esmtp (Exim 4.63) (envelope-from ) id 1OHicT-000134-GR for users@activemq.apache.org; Thu, 27 May 2010 12:19:53 -0700 Message-ID: <28698719.post@talk.nabble.com> Date: Thu, 27 May 2010 12:19:53 -0700 (PDT) From: odysseyfx To: users@activemq.apache.org Subject: Re: Topic Memory Increases until broker dies In-Reply-To: <28370484.post@talk.nabble.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Nabble-From: info@bradwillard.com References: <28370484.post@talk.nabble.com> I've seen this problem fairly frequently. This is caused by a message producer on a topic creating messages faster than a consumer can consume them. Those messages then get backed up on the broker internal dispatch queue for that session until all resources are consumed when the broker deadlocks. There are a few solutions to fix this problem that I have found: configuring and enabling flow control (which will throttle the message producer), enable a message eviction policy (where the broker will start throwing out the oldest messages of the lowest priority that aren't consumed fast enough), or finally you can actually use a durable subscriber if the message producer rate will slow down enough at some point in time for the consumers to catch up, otherwise you'll wind up with the same problem backing up on a queue instead. Another solution is Virtual Topics, and activemq has a whole page on exactly this scenario http://activemq.apache.org/slow-consumer-handling.html and http://activemq.apache.org/virtual-destinations.html I want to add that there is no tuning guide out there to get flow control to work properly, and it's a pain in the ass to setup. You'll need someone who knows the code to help, there is no document on this but there should be. Good luck, Brad E White wrote: > > We have a java swing client that gets its data updates by subscribing to > an ActiveMQ topic. All clients (about a hundred at any given time) > subscribe to the same topic. Subscribers vary and are not durable, but > the messages are persistent. > > I have seen the "inflight count" slowly, but steadily increase and then > the "memory percent used" value spike, leaving the broker deadlocked and > no longer processing messages, but not failing. The whole scenario takes > about a week. And this makes our client application look like it is hung > after it occurs. > > How do I keep messages from getting orphaned when a user closes their > client? I think that is where most of my "inflight" number is coming > from. Users close the client right as it has received a message but > before it can send the ack. > How do I make "inflight" messages expire? I've played around with setting > "timetolive" in my test environment, but it does not seem to affect > messages that are stuck "inflight". > > We are using ActiveMQ 5.3.0. > > > > -- View this message in context: http://old.nabble.com/Topic-Memory-Increases-until-broker-dies-tp28370484p28698719.html Sent from the ActiveMQ - User mailing list archive at Nabble.com.