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 D6AAF18E37 for ; Thu, 22 Oct 2015 13:36:00 +0000 (UTC) Received: (qmail 38259 invoked by uid 500); 22 Oct 2015 13:36:00 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 38218 invoked by uid 500); 22 Oct 2015 13:36:00 -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 38201 invoked by uid 99); 22 Oct 2015 13:36:00 -0000 Received: from Unknown (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 22 Oct 2015 13:36:00 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 92401C48FE for ; Thu, 22 Oct 2015 13:35:59 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 3.865 X-Spam-Level: *** X-Spam-Status: No, score=3.865 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, HEADER_FROM_DIFFERENT_DOMAINS=0.001, HTML_MESSAGE=3, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, URI_HEX=1.313, URI_TRY_3LD=0.001] autolearn=disabled Authentication-Results: spamd1-us-west.apache.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from mx1-us-east.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id jPNxMhBhTINs for ; Thu, 22 Oct 2015 13:35:49 +0000 (UTC) Received: from mail-ig0-f170.google.com (mail-ig0-f170.google.com [209.85.213.170]) by mx1-us-east.apache.org (ASF Mail Server at mx1-us-east.apache.org) with ESMTPS id 9538E42AB6 for ; Thu, 22 Oct 2015 13:35:49 +0000 (UTC) Received: by igbni9 with SMTP id ni9so13875605igb.1 for ; Thu, 22 Oct 2015 06:35:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:content-type; bh=LVAliSsidFkx1IsNrpVuL0Faop0aA15bkq3zMGn5A8c=; b=d/89VcaANCFHxDMywHfAydLcsOTVPdr7EBVktoFdkFl/p40vbQsT49DzE9ifXu+B9r bSAe74nmfrfs5MvTxm/5WEkqxygrcmyy4Y9ziCP6O6ZyVV7yEaB7+swhStEPyB65dUYg gdycjwGEiDYyXVfVghSkclqXwFPJ5q0y0cgKl6TxKAcyH7WQcGeQNCUzjiq1+fiw107Q bB1aGdTcIiySHfHq7j4FDW8cymM7W28fBpBlmXoCFXeLOTyNHOm/rdaTvN/8ZxM4GkWz J/fZE661gaJdjtRvBvjQp2O1sk/7BeSJdyhoCqsE83HRH27zD/+0I5WIhZ0oX6fHMr3S k49Q== MIME-Version: 1.0 X-Received: by 10.50.13.4 with SMTP id d4mr16869012igc.14.1445520949153; Thu, 22 Oct 2015 06:35:49 -0700 (PDT) Sender: tbain98@gmail.com Received: by 10.50.78.227 with HTTP; Thu, 22 Oct 2015 06:35:48 -0700 (PDT) Received: by 10.50.78.227 with HTTP; Thu, 22 Oct 2015 06:35:48 -0700 (PDT) In-Reply-To: <1445438152801-4703233.post@n4.nabble.com> References: <1445433386073-4703223.post@n4.nabble.com> <1445435978116-4703230.post@n4.nabble.com> <1445438152801-4703233.post@n4.nabble.com> Date: Thu, 22 Oct 2015 07:35:48 -0600 X-Google-Sender-Auth: c_KE8y5iWrn_-W0b6Ww_Y62DA7Q Message-ID: Subject: Re: Slow MySQL datastore performance. From: Tim Bain To: ActiveMQ Users Content-Type: multipart/alternative; boundary=089e013c65d6b097600522b192bf --089e013c65d6b097600522b192bf Content-Type: text/plain; charset=UTF-8 In your example of 100 consumers, I would expect that when a message is received 100 ack rows would be inserted (ideally in a single transaction), and when each consumer receives its copy of the message one row would be updated (so when they all have finally received it, you'll have done 100 updates). I'm assuming this all makes sense and your question is "why is each update a separate transaction?" Batching updates made within a very short time window into a single transaction is possible, but 1) it's more complicated code because you need to coordinate the requested updates across threads, and 2) you increase latency for some threads because the early ones in the window have to wait till the window closes and the database update is issued before taking their next action (which may depend on the knowledge that the previous ack has been durably recorded), which might be worse than the overhead of starting a transaction. Any solution that wanted to batch several updates from the same thread (i.e. allow the thread to continue working asynchronously) would have to ensure that the actions taken thereafter would not be invalid if the broker crashed without writing them to the database (which I think would be difficult) or would need to relax the guarantees that ActiveMQ makes about how messages are handled (probably not going to happen just to improve performance of a store technology that's infrequently used). On Oct 21, 2015 8:47 AM, "will1" wrote: > Thanks Tim.. If anyone has any relevant benchmarks they could provide, that > would be really useful.. any more thoughts on the original question would > be > appreciated also.. > > > > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/Slow-MySQL-datastore-performance-tp4703223p4703233.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > --089e013c65d6b097600522b192bf--