Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 19391 invoked from network); 8 Jun 2010 21:25:57 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 8 Jun 2010 21:25:57 -0000 Received: (qmail 83786 invoked by uid 500); 8 Jun 2010 21:25:55 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 83752 invoked by uid 500); 8 Jun 2010 21:25:55 -0000 Mailing-List: contact user-help@cassandra.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user@cassandra.apache.org Delivered-To: mailing list user@cassandra.apache.org Received: (qmail 83737 invoked by uid 99); 8 Jun 2010 21:25:55 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jun 2010 21:25:55 +0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of jbellis@gmail.com designates 74.125.82.44 as permitted sender) Received: from [74.125.82.44] (HELO mail-ww0-f44.google.com) (74.125.82.44) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 08 Jun 2010 21:25:49 +0000 Received: by wwc33 with SMTP id 33so967295wwc.31 for ; Tue, 08 Jun 2010 14:25:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:in-reply-to :references:from:date:message-id:subject:to:cc:content-type :content-transfer-encoding; bh=xHII0qttSXH4qwOQ2lA0MBUHB8eT+m/dlgm3fKk3FGM=; b=P+UrvCN5akr0fn2I/AbEmbAoxqPZr3PEaOpUn0LL95eqCXhyZV+U7/ILYxuf878n5E jTtep31pgZGwzNKVLnInp6vpiuhJJKS1sDdLagwJ7DCXwHIuTcN3R7GaQHvMHNbdGkt9 A7/MHqU/4ItxzYD7gO8nh/RSNqb3ZH+DLfXhM= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=cW+NS59DxZk9TjlnkYuNC8mHRyhSa2H1rap1PIMXUCC4Uq1zVJ9FaA0kN4EN+vKtkt fEAWnE6vV578IRp/yv+K5EPl9DRt2HT+Yda2qNYFso/7ALXgXMtLO9XPjK1AdK0ryiTQ 2DkjE7ehLitVDiWBHW1zsKqpKxjt+/6Pq4qdk= Received: by 10.227.157.142 with SMTP id b14mr1856491wbx.183.1276032328770; Tue, 08 Jun 2010 14:25:28 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.17.197 with HTTP; Tue, 8 Jun 2010 14:25:08 -0700 (PDT) In-Reply-To: <0401E33F262B9043A54E494F5700D4E7F5E22C@rwc-exch-prd2.myopwv.com> References: <0401E33F262B9043A54E494F5700D4E7F5E22C@rwc-exch-prd2.myopwv.com> From: Jonathan Ellis Date: Tue, 8 Jun 2010 14:25:08 -0700 Message-ID: Subject: Re: Cassandra 0.6.2 with thrift hector-0.6.0-13 To: user@cassandra.apache.org Cc: dev@cassandra.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org Java transports buffer internally. there is no TBufferedTransport the way there is in C#. (moving to user@) On Tue, Jun 8, 2010 at 10:31 AM, Subrata Roy wro= te: > We are using Cassandra 0.6.2 with hector/thrift client, and our > application performance is really slow. We are not sure that it is > because of hector/thrift connection or not. =A0Jonathan E. and other > people has suggested that using "TBuffferedTransport(TSocket) instead of > a =A0TSocket directly" performance has drastically improved. If that is > the case, why TBuffferedTransport (TSocket) is not added as part of the > hector client by default? Is there any technical reason not to add as > part of the Cassandra 0.6.2/ hector-0.6.0-13 release? > > > > Thanks in advance for your valuable input. > > > > Regards > > Subrata > > > > /// Code snippet from Hector client: CassandraClientFactory.java > > > > private Cassandra.Client createThriftClient(String =A0url, int port) > > =A0 =A0 =A0throws TTransportException , TException { > > =A0 =A0log.debug("Creating a new thrift connection to {}:{}", url, port); > > =A0 =A0TTransport tr; > > =A0 =A0if (useThriftFramedTransport) { > > =A0 =A0 =A0tr =3D new TFramedTransport(new TSocket(url, port, timeout)); > > =A0 =A0} else { > > =A0 =A0 =A0tr =3D new TSocket(url, port, timeout); =A0 =A0 =A0 =A0 =A0 = =A0 =A0 --- change to > TBuffferedTransport () for better performance > > =A0 =A0} > > =A0 =A0TProtocol proto =3D new TBinaryProtocol(tr); > > =A0 =A0Cassandra.Client client =3D new Cassandra.Client(proto); > > =A0 =A0try { > > =A0 =A0 =A0tr.open(); > > =A0 =A0} catch (TTransportException e) { > > =A0 =A0 =A0// Thrift exceptions aren't very good in reporting, so we have= to > catch the exception here and > > =A0 =A0 =A0// add details to it. > > =A0 =A0 =A0log.error("Unable to open transport to " + url + ":" + port, e= ); > > =A0 =A0 =A0clientMonitor.incCounter(Counter.CONNECT_ERROR); > > =A0 =A0 =A0throw new TTransportException("Unable to open transport to " += url > + ":" + port + " , " + > > =A0 =A0 =A0 =A0 =A0e.getLocalizedMessage(), e); > > =A0 =A0} > > =A0 =A0return client; > > =A0} > > > > > > > > --=20 Jonathan Ellis Project Chair, Apache Cassandra co-founder of Riptano, the source for professional Cassandra support http://riptano.com