Return-Path: Delivered-To: apmail-cassandra-user-archive@www.apache.org Received: (qmail 76188 invoked from network); 19 Oct 2010 22:31:19 -0000 Received: from unknown (HELO mail.apache.org) (140.211.11.3) by 140.211.11.9 with SMTP; 19 Oct 2010 22:31:19 -0000 Received: (qmail 83609 invoked by uid 500); 19 Oct 2010 22:31:17 -0000 Delivered-To: apmail-cassandra-user-archive@cassandra.apache.org Received: (qmail 83579 invoked by uid 500); 19 Oct 2010 22:31:16 -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 83571 invoked by uid 99); 19 Oct 2010 22:31:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Oct 2010 22:31:16 +0000 X-ASF-Spam-Status: No, hits=4.4 required=10.0 tests=FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,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 wav100@gmail.com designates 209.85.213.44 as permitted sender) Received: from [209.85.213.44] (HELO mail-yw0-f44.google.com) (209.85.213.44) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Oct 2010 22:31:10 +0000 Received: by ywa6 with SMTP id 6so1799800ywa.31 for ; Tue, 19 Oct 2010 15:30:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:content-type; bh=6nJePogAiKNIUMen8xTPdEDPpWEP/bQQwqZKhp8GMbY=; b=vwnbONaY4Kg2DPhL1HhBa3dr7xRmeNHigzzp3fWgxTLU+wqmNVfDSFvAtLInAqxVc8 fbE9jcrTeYtJHJzEawwj98C9RHmfmLVVyKAfKgaQJdvpcqXZKU2sqJYM1LkrFqa1HNrv l+w1VN6RpZyWU2x3YOPsppgTtImqA71PcKDTE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; b=VHrDYzU98EPmvZGlmiya7tsPF1gqOrUbK08YOa7r0s6JQQoZ8cH4AoOaarhY/Obj4M D7dpK0EqOFyYqmUQQ4lcEZa107oTcSsyyN5WFbAeRpOy/fEWwiTWqh7MT/nTawKt4u4F DzRRPhVDUN+5vuEpORgh5x57+ouKQbc0b1Dvs= MIME-Version: 1.0 Received: by 10.100.193.9 with SMTP id q9mr4465050anf.264.1287527447585; Tue, 19 Oct 2010 15:30:47 -0700 (PDT) Received: by 10.100.108.6 with HTTP; Tue, 19 Oct 2010 15:30:47 -0700 (PDT) In-Reply-To: <95840f5e-0a3f-e5c3-8dba-a623a251ba43@me.com> References: <95840f5e-0a3f-e5c3-8dba-a623a251ba43@me.com> Date: Tue, 19 Oct 2010 18:30:47 -0400 Message-ID: Subject: Re: Read Latency From: Wayne To: user@cassandra.apache.org Content-Type: multipart/alternative; boundary=0016e645a3f626e58b0492ffd855 X-Virus-Checked: Checked by ClamAV on apache.org --0016e645a3f626e58b0492ffd855 Content-Type: text/plain; charset=ISO-8859-1 I am not sure how many bytes, but we do convert the cassandra object that is returned in 3s into a dictionary in ~1s and then again into a custom python object in about ~1.5s. Expectations are based on this timing. If we can convert what thrift returns into a completely new python object in 1s why does thrift need 3s to give it to us? To us it is like the MySQL client we use in python. It is really C wrapped in python and adds almost zero overhead to the time it takes mysql to return the data. That is the expectation we have and the performance we are looking to get to. Disk I/O + 20%. We are returning one big row and this is not our normal use case but a requirement for us to use Cassandra. We need to get all data for a specific value, as this is a secondary index. It is like getting all users in the state of CA. CA is the key and there is a column for every user id. We are testing with 600,000 but this will grow to 10+ million in the future. We can not test .7 as we are only using .6.6. We are trying to evaluate Cassandra and stability is one concern so .7 is definitely not for us at this point. Thanks. On Tue, Oct 19, 2010 at 4:27 PM, Aaron Morton wrote: > > Just wondering how many bytes you are returning to the client to get an > idea of how slow it is. > > The call to fastbinary is decoding the wireformat and creating the Python > objects. When you ask for 600,000 columns your are creating a lot of python > objects. Each column will be a ColumnOrSuperColumn, wrapping a Column, which > has probably 2 Strings. So 2.4 million python objects. > > Here's my rough test script. > > def go(count): > start = time.time() > buffer = [ > ttypes.ColumnOrSuperColumn(column=ttypes.Column( > "column_name_%s" % i, "row_size of something something", 0, 0)) > for i in range(count) > ] > print "Done in %s" % (time.time() - start) > > On my machine that takes 13 seconds for 600,000 and 0.04 for 10,000. The > fastbinary module is running a lot faster because it's all in c. It's not a > great test but I think it gives an idea of what you are asking for. > > I think there is an element of python been slower than other languages. But > IMHO you are asking for a lot of data. Can you ask for less data? > > Out of interest are you able to try the avro client? It's still > experimental (0.7 only) but may give you something to compare it against. > > Aaron > On 20 Oct, 2010,at 07:23 AM, Wayne wrote: > > It is an entire row which is 600,000 cols. We pass a limit of 10million to > make sure we get it all. Our issue is that it seems Thrift itself has more > overhead/latency added to a read that Cassandra takes itself to do the read. > If cfstats for the slowest node reports 2.25s to us it is not acceptable > that the data comes back to the client in 5.5s. After working with Jonathon > we have optimized Cassandra itself to return the quorum read in 2.7s but we > still have 3s getting lost in the thrift call (fastbinary.decode_binary). > > We have seen this pattern totally hold for ms reads as well for a few cols, > but it is easier to look at things in seconds. If Cassandra can get the data > off of the disks in 2.25s we expect to have the data in a Python object in > under 3s. That is a totally realistic expectation from our experience. All > latency needs to be pushed down to disk random read latency as that should > always be what takes the longest. Everything else is passing through memory. > > > On Tue, Oct 19, 2010 at 2:06 PM, aaron morton wrote: > >> Wayne, >> I'm calling cassandra from Python and have not seen too many 3 second >> reads. >> >> Your last email with log messages in it looks like your are asking for >> 10,000,000 columns. How much data is this request actually transferring to >> the client? The column names suggest only a few. >> >> DEBUG [pool-1-thread-64] 2010-10-18 19:25:28,867 StorageProxy.java (line >> 471) strongread reading data for SliceFromReadCommand(table='table', >> key='key1', column_parent='QueryPath(columnFamilyName='fact', >> superColumnName='null', columnName='null')', start='503a', finish='503a7c', >> reversed=false, count=10000000) from 698@/x.x.x.6 >> >> Aaron >> >> >> On 20 Oct 2010, at 06:18, Jonathan Ellis wrote: >> >> > I would expect C++ or Java to be substantially faster than Python. >> > However, I note that Hector (and I believe Pelops) don't yet use the >> > newest, fastest Thrift library. >> > >> > On Tue, Oct 19, 2010 at 8:21 AM, Wayne wrote: >> >> The changes seems to do the trick. We are down to about 1/2 of the >> original >> >> quorum read performance. I did not see any more errors. >> >> >> >> More than 3 seconds on the client side is still not acceptable to us. >> We >> >> need the data in Python, but would we be better off going through Java >> or >> >> something else to increase performance? All three seconds are taken up >> in >> >> Thrift itself (fastbinary.decode_binary(self, iprot.trans, >> (self.__class__, >> >> self.thrift_spec))) so I am not sure what other options we have. >> >> >> >> Thanks for your help. >> >> >> > >> > >> > >> > -- >> > Jonathan Ellis >> > Project Chair, Apache Cassandra >> > co-founder of Riptano, the source for professional Cassandra support >> > http://riptanocom >> >> > --0016e645a3f626e58b0492ffd855 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I am not sure how many bytes, but we do convert the cassandra object that i= s returned in 3s into a dictionary in ~1s and then again into a custom pyth= on object in about ~1.5s. Expectations are based on this timing. If we can = convert what thrift returns into a completely new python object in 1s why d= oes thrift need 3s to give it to us?

To us it is like the MySQL client we use in python. It is really C wrap= ped in python and adds almost zero overhead to the time it takes mysql to r= eturn the data. That is the expectation we have and the performance we are = looking to get to. Disk I/O + 20%.

We are returning one big row and this is not our normal use case but a = requirement for us to use Cassandra. We need to get all data for a specific= value, as this is a secondary index. It is like getting all users in the s= tate of CA. CA is the key and there is a column for every user id. We are t= esting with 600,000 but this will grow to 10+ million in the future.

We can not test .7 as we are only using .6.6. We are trying to evaluate= Cassandra and stability is one concern so .7 is definitely not for us at t= his point.

Thanks.


On Tue, Oct= 19, 2010 at 4:27 PM, Aaron Morton <aaron@thelastpickle.com> wrote:

=A0Just wondering how many bytes you are returning to the client to get a= n idea of how slow it is.=A0

The call to fastbinary is decoding the wireformat and c= reating the Python objects. When you ask for 600,000 columns your are creat= ing a lot of python objects. Each column will be a ColumnOrSuperColumn, wra= pping a Column, which has probably 2 Strings. So 2.4 million python objects= .

Here's =A0my rough test script.=A0

def go(count):
=A0=A0 =A0start =3D time.time()
=A0=A0 =A0buffer =3D [
=A0=A0 =A0 =A0 =A0ttypes.ColumnOrSuperCol= umn(column=3Dttypes.Column(
=A0=A0 =A0 =A0 =A0 =A0 =A0"column_name_%s" % i, "row_si= ze of something something", 0, 0))
=A0=A0 =A0 =A0 =A0for i i= n range(count)
=A0=A0 =A0]
=A0=A0 =A0print "Done i= n %s" % (time.time() - start)

On my machine that takes 13 seconds for 600,000 and 0.0= 4 for 10,000. The fastbinary module is running a lot faster because it'= s all in c. =A0It's not a great test but I think it gives an idea of wh= at you are asking for.

I think there is an element of python been slower than = other languages. But IMHO you are asking for a lot of data. Can you ask for= less data?=A0

Out of interest are you able to try the avro c= lient? It's still experimental (0.7 only) but may give you something to= compare it against.=A0

Aaron
On 20 Oct,= 2010,at 07:23 AM, Wayne <wav100@gmail.com> wrote:

It is an entire row which is 600,000= cols. We pass a limit of 10million to make sure we get it all. Our issue i= s that it seems Thrift itself has more overhead/latency added to a read tha= t Cassandra takes itself to do the read. If cfstats for the slowest node re= ports 2.25s to us it is not acceptable that the data comes back to the clie= nt in 5.5s. After working with Jonathon we have optimized Cassandra itself = to return the quorum read in 2.7s but we still have 3s getting lost in the = thrift call (fastbinary.decode_binary).

We have seen this pattern totally hold for ms reads as well for a few c= ols, but it is easier to look at things in seconds. If Cassandra can get th= e data off of the disks in 2.25s we expect to have the data in a Python obj= ect in under 3s. That is a totally realistic expectation from our experienc= e. All latency needs to be pushed down to disk random read latency as that = should always be what takes the longest. Everything else is passing through= memory.


On Tue, Oct 19, 2010 at 2:06 PM, aaron morton <= ;aaron@thelast= pickle.com> wrote:
=
Wayne,
I'm calling cassandra from Python and have not seen too many 3 second r= eads.

Your last email with log messages in it looks like your are asking for 10,0= 00,000 columns. How much data is this request actually transferring to the = client? The column names suggest only a few.

DEBUG [pool-1-thread-64] 2010-10-18 19:25:28,867 StorageProxy.java (line 47= 1) strongread reading data for SliceFromReadCommand(table=3D'table'= , key=3D'key1', column_parent=3D'QueryPath(columnFamilyName=3D&= #39;fact', superColumnName=3D'null', columnName=3D'null'= ;)', start=3D'503a', finish=3D'503a7c', reversed=3Dfals= e, count=3D10000000) from 698@/x.x.x.6

Aaron


On 20 Oct 2010, at 06:18, Jonathan Ellis wrote:

> I would expect C++ or Java to be substantially faster than Python.
> However, I note that Hector (and I believe Pelops) don't yet use t= he
> newest, fastest Thrift library.
>
> On Tue, Oct 19, 2010 at 8:21 AM, Wayne <wav100@gmail.com> wrote:
>> The changes seems to do the trick. We are down to about 1/2 of the= original
>> quorum read performance. I did not see any more errors.
>>
>> More than 3 seconds on the client side is still not acceptable to = us. We
>> need the data in Python, but would we be better off going through = Java or
>> something else to increase performance? All three seconds are take= n up in
>> Thrift itself (fastbinary.decode_binary(self, iprot.trans, (self._= _class__,
>> self.thrift_spec))) so I am not sure what other options we have. >>
>> Thanks for your help.
>>
>
>
>
> --
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of Riptano, the source for professional Cassandra support
> http://riptanocom=



--0016e645a3f626e58b0492ffd855--