Return-Path: X-Original-To: apmail-qpid-users-archive@www.apache.org Delivered-To: apmail-qpid-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 924B0113C1 for ; Sat, 21 Jun 2014 12:02:04 +0000 (UTC) Received: (qmail 85630 invoked by uid 500); 21 Jun 2014 12:02:04 -0000 Delivered-To: apmail-qpid-users-archive@qpid.apache.org Received: (qmail 85592 invoked by uid 500); 21 Jun 2014 12:02:04 -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 85576 invoked by uid 99); 21 Jun 2014 12:02:04 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 Jun 2014 12:02:04 +0000 X-ASF-Spam-Status: No, hits=-3.7 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS,URI_HEX X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of crolke@redhat.com designates 209.132.183.25 as permitted sender) Received: from [209.132.183.25] (HELO mx4-phx2.redhat.com) (209.132.183.25) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 21 Jun 2014 12:01:59 +0000 Received: from zmail12.collab.prod.int.phx2.redhat.com (zmail12.collab.prod.int.phx2.redhat.com [10.5.83.14]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id s5LC1c4l010840 for ; Sat, 21 Jun 2014 08:01:38 -0400 Date: Sat, 21 Jun 2014 08:01:35 -0400 (EDT) From: Chuck Rolke To: users@qpid.apache.org Message-ID: <1938821294.1767059.1403352095796.JavaMail.zimbra@redhat.com> In-Reply-To: <1403028652612-7609368.post@n2.nabble.com> References: <1403028652612-7609368.post@n2.nabble.com> Subject: Re: Why performance of sending durable messages to qpid queue is really bad? MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Originating-IP: [10.5.82.12] X-Mailer: Zimbra 8.0.6_GA_5922 (ZimbraWebClient - FF29 (Linux)/8.0.6_GA_5922) Thread-Topic: Why performance of sending durable messages to qpid queue is really bad? Thread-Index: wVGo1W/5mFIbT1k+5ci7VB6j7e8kWw== X-Virus-Checked: Checked by ClamAV on apache.org Also in passing the original code doesn't calculate the time delta correctly. > seconds = end.tv_sec - start.tv_sec; > useconds = end.tv_usec - start.tv_usec; > mtime = ((seconds) * 1000 + useconds/1000.0) + 0.5; fails to account for the borrow from microseconds into seconds so you will get odd results regularly. Use timersub() to calculate the delta. Info in man timeradd. ----- Original Message ----- > From: "smartdog" > To: users@qpid.apache.org > Sent: Tuesday, June 17, 2014 2:10:52 PM > Subject: Why performance of sending durable messages to qpid queue is really bad? > > With Proton c++ client, it seems sending an undurable message to a qpid queue > takes 1-3ms, while sending a durable message takes static 1000ms. Is it by > design? Why does it take so much time? > > My code: > pn_message_set_durable(message, true); > > for(i=0;i<10;i++){ > gettimeofday(&start, NULL); > printf("sending %d ", i); > pn_messenger_put(messenger, message); > messageTracker = pn_messenger_outgoing_tracker(messenger); > pn_messenger_send(messenger, -1); > > pn_status_t trackerStatus = pn_messenger_status(messenger, > messageTracker); > if(trackerStatus != PN_STATUS_ACCEPTED) printf("send Azure failed! %d\n", > trackerStatus); > else pn_messenger_settle(messenger,messageTracker,0); > > gettimeofday(&end, NULL); > seconds = end.tv_sec - start.tv_sec; > useconds = end.tv_usec - start.tv_usec; > mtime = ((seconds) * 1000 + useconds/1000.0) + 0.5; > printf(" after send one Elapsed time: %ld milliseconds\n", mtime); > } > > > > -- > View this message in context: > http://qpid.2158936.n2.nabble.com/Why-performance-of-sending-durable-messages-to-qpid-queue-is-really-bad-tp7609368.html > Sent from the Apache Qpid users mailing list archive at Nabble.com. > > --------------------------------------------------------------------- > 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