Return-Path: X-Original-To: apmail-activemq-users-archive@www.apache.org Delivered-To: apmail-activemq-users-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 25E7810A2C for ; Wed, 5 Jun 2013 16:03:47 +0000 (UTC) Received: (qmail 28614 invoked by uid 500); 5 Jun 2013 16:03:46 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 28521 invoked by uid 500); 5 Jun 2013 16:03:45 -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 28407 invoked by uid 99); 5 Jun 2013 16:03:44 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jun 2013 16:03:44 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=HTML_MESSAGE,NORMAL_HTTP_TO_IP,RCVD_IN_DNSWL_LOW,SPF_PASS,WEIRD_PORT X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of christian.posta@gmail.com designates 209.85.215.44 as permitted sender) Received: from [209.85.215.44] (HELO mail-la0-f44.google.com) (209.85.215.44) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 05 Jun 2013 16:03:36 +0000 Received: by mail-la0-f44.google.com with SMTP id er20so1616923lab.31 for ; Wed, 05 Jun 2013 09:03:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=pGLhfx2x++J4KXfQISf0O7790cXIrIigEIiq71f+j7Y=; b=MC5SV2/2QYkG3fN5DJ3TV/dahHGFeazv1AUuwXqmCLnjUFxUZLLv43eYlJYvK2Yo76 AIkrR/mIoCgwDT+xKVEDqSWQ7t8FL/GXFYGEKPNCqz+sqmvWpSjjUURZKtgSbbBmCG+1 nrbPhGAuPXvHJpfHW1dA2kvm38bFC5HBFlnQjVH+95Ckmcaz7xUo2vn5AhCAK/LEZRVx 0wwJ9iYakhLlabkTfepOI5uyDKW3W1flS1S3+GD+H0mxoMBEnodamqwZwWvFmRHhbzmU ivpA7ruA8cAsep5UiJsSeZWu6YDCaQgK8VzjXBdt6+1+Q7SFzoz6eRd4bf0uR+MrX2y5 68sg== MIME-Version: 1.0 X-Received: by 10.112.22.97 with SMTP id c1mr15050357lbf.52.1370448195914; Wed, 05 Jun 2013 09:03:15 -0700 (PDT) Received: by 10.114.98.35 with HTTP; Wed, 5 Jun 2013 09:03:15 -0700 (PDT) In-Reply-To: References: <20130605152432.GB11823@pleuron.we7.local> <6755E4F1-E2E8-480D-AD0C-20BD7A2DF00A@gmail.com> Date: Wed, 5 Jun 2013 09:03:15 -0700 Message-ID: Subject: Re: Understanding memoryLimits with flow control and systemUsage limits. From: Christian Posta To: "users@activemq.apache.org" Content-Type: multipart/alternative; boundary=14dae9473607e6944f04de6a55cb X-Virus-Checked: Checked by ClamAV on apache.org --14dae9473607e6944f04de6a55cb Content-Type: text/plain; charset=ISO-8859-1 was just thinking... for question #3, it would make sense if the overall broker memory was 500MB and your temp was 100MB... then when you hit the cursor high water mark at some point (70%) it would spook to disk and overload the temp... in that case, you have to ensure the temp storage is sufficient to handle your messages from memory.... but as you described it (500mb per destination, 20mb overall) then it doesn't work. On Wed, Jun 5, 2013 at 8:57 AM, Christian Posta wrote: > Sounds like it's happening exactly as you have it configured.. I assume > you're using non-persistent messages? > > As Johan pointed out, your config kinda doesn't make sense :) > > The is an overall broker limit. That is, if you set your > then you want to keep the aggregate of all of > your destinations <= 40mb. Therefore, if you have 40 queues, set each one > to 1mb. Or some other combo that is <= 40mb. In your case you set each > queue to 50mb ( As for your questions... > > 1) the 50mb limit doesn't kick in (you don't get PFC) because the broker > has hit the 70% limit and is spooling your messages to disk. in the first > case, it never hits the 70% mem limit of your destination because it filled > up (40mb) the broker main memory first > > 2) it sure is happening :) check the logs for scenario #2... you hit the > limit on the temp store > > 3) that doesn't make sense. whip up a test case to show that. > > hope that helps :) > > > On Wed, Jun 5, 2013 at 8:39 AM, Johan Edstrom wrote: > >> Do it the other way around. >> The system and store settings are global, the others per destination. >> So what you are doing doesn't make a ton of sense. >> >> >> On Jun 5, 2013, at 9:24 AM, Jesus Roncero wrote: >> >> > Hi all, >> > >> > I've got a testing activeMQ installation that I'm trying to test >> regarding >> > different limits on destinations and memory usage in general, with and >> without >> > flowControl enable. I'm running into some issues and I don't quite >> understand >> > how this works, so I would appreciate any tips or advise here. >> > >> > My setup is activeMQ 5.6 in a testing environment. I'm using a couple of >> > python scripts that use stomp.py to send some messages and read them >> from a >> > testqueue. Depending on a couple of settings, the behaviour changes, >> and it >> > behaves differently. >> > >> > I'm sendind 1 Mb messages to the queue as per: >> > >> > data = "x" * 1024 * 1024 >> > number = 1000 >> > print "producing %s %s kb messages" % (number, len(data) / 1024) >> > for i in range(number): >> > print i >> > conn.send(data, destination='/queue/testqueue') >> > >> > in python. >> > >> > Now, I have two settings: >> > >> > Scenario number 1 >> > ---------------- >> > >> > >> > > producerFlowControl="true"> >> > >> > >> > >> > >> > > producerFlowControl="true"> >> > >> > >> > >> > >> > >> > >> > >> > >> > ... >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > Where the memoryLimit of each of the queues is bigger than the limit for >> > memoryUsage. When I try to insert into the queue, it insert 32 messages >> (32Mb) >> > and it hangs in there. I see this log messages: >> > >> > [2013-06-05 15:54:19,816] INFO ActiveMQ Transport: tcp:/// >> 10.0.9.124:36431 org.apache.activemq.broker.region.Queue - Usage Manager >> Memory Limit (52428800) reached on queue://testqueue. Producers will be >> throttled to the rate at which messages are removed from this destination >> to prevent flooding it. See >> http://activemq.apache.org/producer-flow-control.html for more info >> > 2013-06-05 15:54:19,816 [0.0.9.124:36431] INFO Queue - Usage Manager >> Memory Limit (52428800) reached on queue://testqueue. Producers will be >> throttled to the rate at which messages are removed from this destination >> to prevent flooding it. See >> http://activemq.apache.org/producer-flow-control.html for more info >> > [2013-06-05 15:54:20,818] INFO ActiveMQ Transport: tcp:/// >> 10.0.9.124:36431 org.apache.activemq.broker.region.Queue - >> Usage(default:memory:queue://testqueue:memory) percentUsage=62%, >> usage=32537724, limit=52428800, >> percentUsageMinDelta=1%;Parent:Usage(default:memory) percentUsage=101%, >> usage=42443902, limit=41943040, percentUsageMinDelta=1%: Usage Manager >> Memory Limit reached. Producer (ID:meme-49473-1370444050426-2:1:-1:1) >> stopped to prevent flooding queue://testqueue. See >> http://activemq.apache.org/producer-flow-control.html for more info >> (blocking for: 1s) >> > 2013-06-05 15:54:20,818 [0.0.9.124:36431] INFO Queue - >> Usage(default:memory:queue://testqueue:memory) percentUsage=62%, >> usage=32537724, limit=52428800, >> percentUsageMinDelta=1%;Parent:Usage(default:memory) percentUsage=101%, >> usage=42443902, limit=41943040, percentUsageMinDelta=1%: Usage Manager >> Memory Limit reached. Producer (ID:meme-49473-1370444050426-2:1:-1:1) >> stopped to prevent flooding queue://testqueue. See >> http://activemq.apache.org/producer-flow-control.html for more info >> (blocking for: 1s) >> > >> > Which would indicate that flow control kicked in as per the first >> message, >> > that they reach a memory limit (50Mb) as per the per destination limit >> (second >> > message). It also says that the memory (40Mb) got used as a 100%. >> > >> > Also, noted that it says: default:memory:queue. >> > >> > >> > Scenario number 2 >> > ----------------- >> > >> > Now, if I change the memoryUsage to be slightly bigger than the >> memoryLimit on >> > each queue, from 40 to 60Mb, as per: >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > >> > taking into account that the per-destination limits are just the same, >> 50Mb as >> > per the config above. When I run the same exact procedure, it inserts >> 801 1Mb >> > messages and it stops with this message: >> > >> > [2013-06-05 16:05:01,972] INFO BrokerService.worker.1 >> org.apache.activemq.store.kahadb.plist.PListStore - >> PListStore:[/var/lib/activemq/we7/data/localhost/tmp_storage ] initialized >> > 2013-06-05 16:05:01,972 [ervice.worker.1] INFO PListStore - >> PListStore:[/var/lib/activemq/we7/data/localhost/tmp_storage ] initialized >> > [2013-06-05 16:05:12,959] INFO ActiveMQ Transport: tcp:/// >> 10.0.9.124:36615 org.apache.activemq.broker.region.Queue - >> Usage(default:temp:queue://testqueue:temp) percentUsage=99%, >> usage=839122944, limit=838860800, >> percentUsageMinDelta=1%;Parent:Usage(default:temp) percentUsage=100%, >> usage=839122944, limit=838860800, percentUsageMinDelta=1%: Temp Store is >> Full (99% of 838860800). Stopping producer >> (ID:meme-55481-1370444692514-2:1:-1:1) to prevent flooding >> queue://testqueue. See >> http://activemq.apache.org/producer-flow-control.html for more info >> (blocking for: 1s) >> > 2013-06-05 16:05:12,959 [0.0.9.124:36615] INFO Queue - >> Usage(default:temp:queue://testqueue:temp) percentUsage=99%, >> usage=839122944, limit=838860800, >> percentUsageMinDelta=1%;Parent:Usage(default:temp) percentUsage=100%, >> usage=839122944, limit=838860800, percentUsageMinDelta=1%: Temp Store is >> Full (99% of 838860800). Stopping producer >> (ID:meme-55481-1370444692514-2:1:-1:1) to prevent flooding >> queue://testqueue. See >> http://activemq.apache.org/producer-flow-control.html for more info >> (blocking for: 1s) >> > >> > Where I see that it starts using the tempUsage space, and it pauses >> when it's >> > used the 800 Mb available, whining that the temp store is full. >> > >> > Now, the type is default:temp:queue rather than memory >> > >> > So, >> > >> > Could anyone explain to me why this is? I've read quite a few blog >> posts and >> > entries on the mailing list and I'm still a bit confused about it, so, >> to have >> > more concrete questions, >> > >> > 1) Why this change on the memoryUsage limit affects how activeMQ deals >> with >> > way too many messages? More so, why on the second example, the 50 Mb >> limit >> > doesn't kick in? >> > >> > 2) I uderstood that activeMQ passes messages to the temp storage area >> when a >> > queue is full 70% (unless configured otherwise), but this is not >> happening >> > here. Why? >> > >> > 3) I've seen a case where each queue is configured with a 500Mb limit, >> > memoryUsage limit is 20Mb and tempUsage is 100Mb, activeMQ accepts 350 >> Mb >> > worth of messages (70% of 500 Mb) and then it writes it the temporary >> storage, >> > and then it hangs, complaining temp storage is 350% of the maximum >> value. >> > Then, there's no way to recover activeMQ unless with a restart. >> > >> > >> > Any ideas/suggestions/pointers would be appreciated, as I'm getting a >> bit >> > frustrated trying to understand this :-) >> > >> > Apologies for the length of the email, hope is easily understandable. >> > >> > Thanks. >> > Regards. >> > >> > -- >> > JRF >> >> > > > -- > *Christian Posta* > http://www.christianposta.com/blog > twitter: @christianposta > -- *Christian Posta* http://www.christianposta.com/blog twitter: @christianposta --14dae9473607e6944f04de6a55cb--