Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id A5B64200C6C for ; Fri, 5 May 2017 16:34:25 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id A043E160BAF; Fri, 5 May 2017 14:34:25 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id BFDBE160B97 for ; Fri, 5 May 2017 16:34:24 +0200 (CEST) Received: (qmail 35600 invoked by uid 500); 5 May 2017 14:34:23 -0000 Mailing-List: contact users-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: users@qpid.apache.org Delivered-To: mailing list users@qpid.apache.org Received: (qmail 35587 invoked by uid 99); 5 May 2017 14:34:23 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 05 May 2017 14:34:23 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 44D4D1A7A44 for ; Fri, 5 May 2017 14:34:23 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.397 X-Spam-Level: X-Spam-Status: No, score=-0.397 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-2.796, RCVD_IN_SORBS_SPAM=0.5, SPF_PASS=-0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id WrOfgQTbseOw for ; Fri, 5 May 2017 14:34:21 +0000 (UTC) Received: from mail-wr0-f176.google.com (mail-wr0-f176.google.com [209.85.128.176]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id BB3DF5F5CA for ; Fri, 5 May 2017 14:34:20 +0000 (UTC) Received: by mail-wr0-f176.google.com with SMTP id l9so4990566wre.1 for ; Fri, 05 May 2017 07:34:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=EfYBRx7vFsOCJBJhf4hvDzb6XGnIuNyI8Ivvdq0jKGA=; b=fjdkdz8rV5jBA9XLoZ883UYH+BnViZwxt+IbbdWADHyCLJ8oYo2Cna9Q+bUuqHIDIm 2c5d7Yr01ZARqsWxlPiVYQrzH1HPSVuhvvm+kVknxJRZQOFENMo4DTuXE8pGdXXym4eY 67ufD7ZumuJkHKJHti1V/4VZ+oevNU/VJKFKuACpMlI9xn1Ggym0m9uB1Ebz+4oWLtJM OGnR3f9NUM1Q3Qu3zf2ggU+QjzUzew+te1CkwPXegmbHefMGbxviMwGhtOU/TwrBWyum C86hptN1hHzuk5PnimJosxGIXZQBeF6HIHvScP9Lo8oozPhugGwUl1pRgwkiosE9BeII /WSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=EfYBRx7vFsOCJBJhf4hvDzb6XGnIuNyI8Ivvdq0jKGA=; b=XfszbS8vkaFY33fh+/yfylDHrWkLv5Bdlrmx71/wPn3p1PwXWZKNBQYZ3CZb05oxLH NLaVKU8/yxY9HuDmTQfQNbXxVfYhgg7Og26CshHUftEAWoOuKn441H4IcyiNY9KlRH1W HWJC9aQV3acF//q6tnW0UhDUWdkMS7aZcE3VSx/Adpn6ie6GLQvTQ3Kx3oPz5yYwPUXd cziroNESEfdHQkSqcneSMlFX2Z9AYaK2QRJXsqhFpu1q75nIZnPoJwAJVMAbEtw0oNqp w33xowdFTHkneOf7Bnh+t8PQpBePx3AHRC8BS28hbpeC3ZKi6/YxZW3H5oYbKIjzkyMj hpVg== X-Gm-Message-State: AN3rC/6oQx3qASr5WOXmnHuIJpmWn3clnQOtPnJyD+nrZwkzzTx2deez NkGYwpsdpBHZkYxdaxw3EJvl4fjX2nK6 X-Received: by 10.223.142.135 with SMTP id q7mr31716036wrb.180.1493994860171; Fri, 05 May 2017 07:34:20 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Dan Langford Date: Fri, 05 May 2017 14:34:08 +0000 Message-ID: Subject: Re: [Java Client JMS] qpid-jms-client 0.22.0 vs qpid-client 6.1.2: prefetch behaving differently To: "users@qpid.apache.org" Content-Type: multipart/alternative; boundary=f403045f4ec4efd7e6054ec7c882 archived-at: Fri, 05 May 2017 14:34:25 -0000 --f403045f4ec4efd7e6054ec7c882 Content-Type: text/plain; charset=UTF-8 Thanks for the replies and the work around. Getting this working will be great as we mostly use the competing consumer approach here. When somebodies queue gets backed up to half a million messages they want to just scale out their instances in CloudFoundry to increase throughput. On Fri, May 5, 2017 at 7:09 AM Rob Godfrey wrote: > On 5 May 2017 at 14:14, Robbie Gemmell wrote: > > > I can also reproduce this. I believe it is a deficiency in how/when > > the client handles granting more link credit, and it will show > > particularly badly in the scenario described where the broker is able > > to significantly/totally use the existing credit between processing of > > individual messages and there is a backlog of queued messages to > > continuously feed the scenario. > > > > To work around the issue and achieve the effect you are looking for, > > of balancing the backlog between multiple consumers when some come up > > later than others, you will need to reduce the prefetch setting to 0 > > or 1. > > > > > To be clear then, it is a bug in the JMS client rather than the broker :-) > > -- Rob > > > > Robbie > > > > On 5 May 2017 at 10:07, Keith W wrote: > > > Hi Dan > > > > > > Thanks for the comprehensive report. I can reproduce what you see and > > > confirm there appears to be a bug. I'll hope to be able to take a > > > closer look later today or Monday and get back to you with more > > > information. > > > > > > Keith. > > > > > > On 4 May 2017 at 23:39, Dan Langford wrote: > > >> So over the past few weeks we have had a huge influx of messages on > our > > >> enterprise message bus (qpid java 6.0.4 serves the AMQP1.0 messaging > > >> portion) and when one of our clients struggled scaling their > > application up > > >> it got us looking at prefetch. we thought it was odd that all 500k > > messages > > >> in the queue were prefetched and it was due to the prefetch that when > > they > > >> scaled out the new connections could help with those messages they > could > > >> only acquire new messages. > > >> > > >> so i started running tests on a local instance of qpid java 6.1.2 and > i > > was > > >> able to duplicate the behavior which seems odd. > > >> > > >> Setup. > > >> my java code will use the JMS api to create a consumer, receiveNoWait > a > > >> message, acknowledge or commit the message, then Thread.sleep for a > bit > > to > > >> look at the Qpid Java Brokers web interface for stats around > prefetched > > >> messages. > > >> > > >> Test 1. qpid-jms-client 0.22.0 with prefetch of 10 set via jms url > > >> parameter (jms.prefetchPolicy.all=10) OR set via PreFetchPolicy on the > > >> ConnectionFactory (jmsDefaultPrefetchPolicy.setAll(10);) > > >> After the first message came in the web interface showed the queue > size > > >> decrement and 19 messages pre-fetched > > >> after second message queue size decremented again and 28 messages are > > >> pre-fetched > > >> after third message queue size also decremented and 37 messages > > prefetched > > >> so on and so forth > > >> > > >> Test 2. qpid-client 6.1.2 with prefetch of 10 set via url param > > >> maxprefetch='10' > > >> After the first message came in the web interface showed the queue > size > > >> decrement and 10 messages pre-fetched > > >> after second message queue size decremented again and still 10 > messages > > are > > >> pre-fetched > > >> after third message queue size also decremented and still 10 messages > > >> prefetched > > >> so on and so forth > > >> > > >> could it be a link credit thing? could i not be understanding > prefetch? > > >> maybe jms.prefetchPolicy is not the same as maxprefetch? > > >> > > >> Frame logs are here > > >> https://pastebin.com/4NHGCWEa > > > > > > --------------------------------------------------------------------- > > > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org > > > For additional commands, e-mail: users-help@qpid.apache.org > > > > > > > --------------------------------------------------------------------- > > To unsubscribe, e-mail: users-unsubscribe@qpid.apache.org > > For additional commands, e-mail: users-help@qpid.apache.org > > > > > --f403045f4ec4efd7e6054ec7c882--