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 4853484C2 for ; Wed, 10 Aug 2011 15:47:40 +0000 (UTC) Received: (qmail 40187 invoked by uid 500); 10 Aug 2011 15:47:39 -0000 Delivered-To: apmail-activemq-users-archive@activemq.apache.org Received: (qmail 40123 invoked by uid 500); 10 Aug 2011 15:47:39 -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 40109 invoked by uid 99); 10 Aug 2011 15:47:38 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Aug 2011 15:47:38 +0000 X-ASF-Spam-Status: No, hits=1.5 required=5.0 tests=FREEMAIL_FROM,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of herve.barrault@gmail.com designates 209.85.213.43 as permitted sender) Received: from [209.85.213.43] (HELO mail-yw0-f43.google.com) (209.85.213.43) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 10 Aug 2011 15:47:30 +0000 Received: by yws29 with SMTP id 29so942649yws.2 for ; Wed, 10 Aug 2011 08:47:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=ugCR7ps7MRPvoTzO1QLfVuqO6O1azuIblfwKC5g4zjE=; b=xyTikWevT4/Fh92eFk7fpkIOgpLAxa8Kj2NBqo1rCrSApuhmoR+8FgutphOU+PKleS Hy3gQN8/ZYYz4jhhwiZtyLFTDLu45sc7Z3wxhx1F239iyJ6NO432Jx0wHVgkSKyU1PXi 7VtuWL36S6W4bJZ94NXjUKlHErTpdL2lgB+eo= MIME-Version: 1.0 Received: by 10.42.169.138 with SMTP id b10mr7893123icz.187.1312991229585; Wed, 10 Aug 2011 08:47:09 -0700 (PDT) Received: by 10.42.227.71 with HTTP; Wed, 10 Aug 2011 08:47:09 -0700 (PDT) In-Reply-To: References: Date: Wed, 10 Aug 2011 17:47:09 +0200 Message-ID: Subject: Re: ActiveMQ performances and JDBC persistence From: =?ISO-8859-1?Q?Herv=E9_BARRAULT?= To: users@activemq.apache.org Content-Type: multipart/alternative; boundary=90e6ba6e87c8d528e204aa2897b3 X-Virus-Checked: Checked by ClamAV on apache.org --90e6ba6e87c8d528e204aa2897b3 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Hi, i have done another experiment : I have tried something to see the influence of messages on ActiveMQ behavior. I try to send 20 messages per seconds during 20 seconds into the broker and use a processor to dequeue the messages. If there is no other messages, it is ok If i create a false queue with 16k messages it is always working If i create a false queue with 24k messages it takes about 25 seconds to do all the job. If i create a false queue with 32k messages it takes about 55 seconds to do all the job. Is there something to do to avoid that a queue has an influence on other queues? Regards 2011/8/1 Herv=E9 BARRAULT > Hi, > I have looked to the purge mechanism to try to understand why it takes so > much time to clean a queue. > > I have noticed something : > > #### > CLASS org.apache.activemq.store.jdbc.Statements > public String getFindMessageSequenceIdStatement() { > if (findMessageSequenceIdStatement =3D=3D null) { > findMessageSequenceIdStatement =3D "SELECT ID, PRIORITY FROM " + > getFullMessageTableName() > + " WHERE MSGID_PROD=3D? AND MSGID_SEQ=3D? AND CONTAINER=3D?"= ; > } > return findMessageSequenceIdStatement; > } > > public String getRemoveMessageStatement() { > if (removeMessageStatement =3D=3D null) { > removeMessageStatement =3D "DELETE FROM " + > getFullMessageTableName() + " WHERE ID=3D?"; > } > return removeMessageStatement; > } > ### > > ### > CLASS org.apache.activemq.store.jdbc.JDBCMessageStore > > private long getStoreSequenceIdForMessageId(MessageId messageId) throws > IOException { > long result =3D -1; > TransactionContext c =3D persistenceAdapter.getTransactionContext= (); > try { > result =3D adapter.getStoreSequenceId(c, destination, > messageId)[0]; > } catch (SQLException e) { > JDBCPersistenceAdapter.log("JDBC Failure: ", e); > throw IOExceptionSupport.create("Failed to get store sequence= Id > for messageId: " + messageId +", on: " + destination + ". Reason: " + e, = e); > } finally { > c.close(); > } > return result; > } > > public void removeMessage(ConnectionContext context, MessageAck ack) thro= ws > IOException { > > long seq =3D getStoreSequenceIdForMessageId(ack.getLastMessageId(= )); > > // Get a connection and remove the message from the DB > TransactionContext c =3D > persistenceAdapter.getTransactionContext(context); > try { > adapter.doRemoveMessage(c, seq); > } catch (SQLException e) { > JDBCPersistenceAdapter.log("JDBC Failure: ", e); > throw IOExceptionSupport.create("Failed to broker message: " = + > ack.getLastMessageId() + " in container: " + e, e); > } finally { > c.close(); > } > } > ### > > Could it be better to use only one request to remove a row, which is : > "DELETE FROM " + getFullMessageTableName() + " WHERE MSGID_PROD=3D? AND > MSGID_SEQ=3D? AND CONTAINER=3D?" ? > or is there a case where it is not working ? > > Could it be better to create an index based on MSGID_PROD, MSGID_SEQ and = CONTAINER > (this index could be UNIQUE ?) ? > > I have checked that it takes 1min30 to dequeue my 16000 messages using th= e > purge method with these two modifications. I noticed that the page size i= s > 200 messages and it waits every 200 row to read from the database to be a= ble > to purge it, i never noticed this limit before. > > So it increases the rate from about 40 msgs/sec to about 170 msgs/sec to > purge a queue (does it can also apply to other components reading the que= ue > ?). > > I don't have enough JMS broker and database mechanism knowledges to say i= f > it is a good or a bad idea. > > Anyone can help me for this ? > > Thanks for answers. > Herv=E9 > > > 2011/7/29 Herv=E9 BARRAULT > >> Hi, >> I am using ActiveMQ 5.4.0 with persistence (using an oracle 11g R2 serve= r) >> and i am doing some performance tests. >> >> I'm sending 16000 messages through web services (using one port) and it >> takes about 1 min to manage all messages and fill the JMS queue. >> >> When i use a consumer to dequeue this queue (without adding new messages= ) >> and fill another one, it takes about 6 min and 30 seconds. I was expecti= ng >> that i have some code which slow down the consumption. >> >> But i have tried to use the purge method and it takes the same time. >> >> Is there a way to increase the consumption rate ? >> >> Thanks for answers. >> > > --90e6ba6e87c8d528e204aa2897b3--