From user-return-6596-apmail-cassandra-user-archive=cassandra.apache.org@cassandra.apache.org Wed Jun 09 23:51:46 2010 Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 37930 invoked from network); 9 Jun 2010 23:51:46 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 9 Jun 2010 23:51:46 -0000 Received: (qmail 97637 invoked by uid 500); 9 Jun 2010 23:51:44 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 97617 invoked by uid 500); 9 Jun 2010 23:51:44 -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 97609 invoked by uid 99); 9 Jun 2010 23:51:44 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jun 2010 23:51:44 +0000 X-ASF-Spam-Status: No, hits=-0.5 required=10.0 tests=AWL,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of agoudarzi@gaiaonline.com designates 208.85.94.60 as permitted sender) Received: from [208.85.94.60] (HELO zms-vm01.sv3.gaiaonline.com) (208.85.94.60) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 09 Jun 2010 23:51:40 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by zms-vm01.sv3.gaiaonline.com (Postfix) with ESMTP id 94914CD40044; Wed, 9 Jun 2010 16:51:19 -0700 (PDT) X-Virus-Scanned: amavisd-new at zms-vm01.sv3.gaiaonline.com Received: from zms-vm01.sv3.gaiaonline.com ([127.0.0.1]) by localhost (zms-vm01.sv3.gaiaonline.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id op0yWB0ET5OR; Wed, 9 Jun 2010 16:51:18 -0700 (PDT) Received: from zms-vm01.sv3.gaiaonline.com (zms-vm01.sv3.gaiaonline.com [208.85.94.60]) by zms-vm01.sv3.gaiaonline.com (Postfix) with ESMTP id DC333CD40043; Wed, 9 Jun 2010 16:51:18 -0700 (PDT) Date: Wed, 9 Jun 2010 16:51:18 -0700 (PDT) From: Arya Goudarzi To: user@cassandra.apache.org, jbellis Message-ID: <4745385.16.1276127473718.JavaMail.arya@aryanet> In-Reply-To: <1396445.13.1276127346567.JavaMail.arya@aryanet> Subject: Re: Strage Read Perfoamnce 1xN column slice or N column slice MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_Part_15_9785950.1276127473710" X-Originating-IP: [192.168.5.2] X-Mailer: Zimbra 6.0.6_GA_2324.RHEL5_64 (Zimbra Desktop/2.0_10414_Mac) ------=_Part_15_9785950.1276127473710 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi Jonathan, This issue persists. I have prepared a code sample which you can use to rep= roduce what I am saying. Please see attached. It is using Thrift PHP librar= ies straight. I am running Cassandra 0.7 build from May 28th. I have tried = this on a single host with replication factor 1 and 3 node cluster with rep= lication factor 3. The results remains similar: 100 Sequential Writes took: 0.60781407356262 seconds; 100 Sequential Reads took: 0.23204588890076 seconds; 100 Batch Read took: 0.76512885093689 seconds; Please advice. Thank You, -Arya ----- Original Message ----- From: "Jonathan Ellis" To: user@cassandra.apache.org Sent: Monday, June 7, 2010 7:26:30 PM Subject: Re: Strage Read Perfoamnce 1xN column slice or N column slice That would be surprising (and it is not what you said in the first message). I suspect something is wrong with your test methodology. On Mon, Jun 7, 2010 at 11:23 AM, Arya Goudarzi wrote: > But I am not comparing reading 1 column vs 100 columns. I am comparing > reading of 100 columns in loop iterations (100 consecutive calls) vs > reading all 100 in batch in one call. Doing the loop is faster than > doing the batch call. Are you saying this is not surprising? > > ----- Original Message ----- > From: "Jonathan Ellis" > To: user@cassandra.apache.org > Sent: Saturday, June 5, 2010 6:26:46 AM > Subject: Re: Strage Read Perfoamnce 1xN column slice or N column slice > > reading 1 column, is faster than reading lots of columns. this > shouldn't be surprising. > > On Fri, Jun 4, 2010 at 3:52 PM, Arya Goudarzi > > wrote: >> Hi Fellows, >> >> I have the following design for a system which holds basically >> key->value pairs (aka Columns) for each user (SuperColumn Key) in >> different namespaces >> (SuperColumnFamily row key). >> >> Like this: >> >> Namesapce->user->column_name =3D column_value; >> >> keyspaces: >> =C2=A0=C2=A0=C2=A0 - name: NKVP >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 replica_placement_strategy: >> org.apache.cassandra.locator.RackUnawareStrategy >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 replication_factor: 3 >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 column_families: >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 - name: Namespaces >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 column_type: Supe= r >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 compare_with: Byt= esType >> =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0 compare_subcolumn= s_with: BytesType >> =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 rows_cached: 20000 >> =C2=A0=C2=A0=C2=A0 =C2=A0=C2=A0=C2=A0 =C2=A0 keys_cached: 100 >> >> Cluster using random partitioner. >> >> I use multiget_slice() for fetching 1 or many columns inside the >> child supercolumn at the same time. This is an awkward performance >> result I >> get: >> >> 100 sequential reads completed in : 0.383 this uses multiget_slice() >> with 1 key, and 1 column name inside the predicate->column_names >> 100 batch loaded completed in : 0.786 this uses multiget_slice() with >> 1 key, and multiple column names inside the predicate->column_names >> >> read/write consistency are ONE. >> >> Questions: >> >> Why doing 100 sequential reads is faster than doing 100 in batch? >> Is this a good design for my problem? >> Does my issue relate to >> https://issues.apache.org/jira/browse/CASSANDRA-598? >> >> Now on a single node with replication factor 1 I get this: >> >> 100 sequential reads completed in : 0.438 >> 100 batch loaded completed in : 0.800 >> >> Please advice as to why is this happening? >> >> These nodes are VMs. 1 CPU and 1 Gb. >> >> Best Regards, >> =3DArya >> >> >> >> >> >> >> >> > > > > -- Jonathan Ellis > Project Chair, Apache Cassandra > co-founder of Riptano, the source for professional Cassandra support > http://riptano.com > -- Jonathan Ellis Project Chair, Apache Cassandra co-founder of Riptano, the source for professional Cassandra support http://riptano.com ------=_Part_15_9785950.1276127473710 Content-Type: application/zip; name=cass_test.php.zip Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename=cass_test.php.zip UEsDBBQACAAIABKFyTwAAAAAAAAAAAAAAAANABAAY2Fzc190ZXN0LnBocFVYDABpKBBMcyYQTG9q ZAC9V21P40YQ/kx+xV4ayQ4kcUBtpZIjFXClrY4WRIL4QJG1rMdkhe317W7g0tP9986sX+IkQAut mg+JvfOys8/zzCx88y6YGx3cyiyA7IHls7z1/kf67vx8enZ0eDq59qa/XPx6Mg0vzs6m3g07YJ6L MDOuIUDPYDrTMrbeqKXh01xqCFUmgD0TP/CCnIt7fgcmENwYnkWaB8fV0wAT/qtM9VNoFzmY1+Wz mmcmV9oG04kS92BfWY5WVgmVBNMjmXG9OC/f31zEieYpRNNq4c15juZxDHozU6uT4QYGYQTi1apU 6Lk0gKaOesxAG1zmWvOF38WlnMvGincPi13vYOw98GQOu16P0cpevbLndWmHmTK2EZQokXBa2/9h 9/th4WIc1uiTwSMrkT9XKvGrvXvLh06OVUlD3id47J8wQaw0cDHzWbkXN+WT1TK7Y90vLYafBIN8 t05JEIMupoDPeaIi8L19LH8laOSCytL6Yx5FE9APoMtdqhyj1tf6AP2xATuBLJrKFNTc+t8Nh0PC rWG+APGwZl7aVQ6ZA1okErIKkLo3jt2qX6C0qrBDISABzS1ElX2dcr/cprc73PvWfXW7bvd7Q/SU e/bHERih5S2ESKZThqGSZMx8xwEth/AZwTS+d6gXPPxY+nk9StXtsi+trTqbWRgLaRhpldcJ1+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