You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by "John R. Frank" <jr...@mit.edu> on 2013/05/10 03:09:06 UTC
pycassa failures in large batch cycling
C* users,
We have a process that loads a large batch of rows from Cassandra into
many separate compute workers. The rows are one-column wide and range in
size for a couple KB to ~100 MB. After manipulating the data for a while,
each compute worker writes the data back with *new* row keys computed by
the workers (UUIDs).
After the full batch is written back to new rows, a cleanup worker deletes
the old rows.
After several cycles, pycassa starts getting connection failures.
Should we use a pycassa listener to catch these failures and just recreate
the ConnectionPool and keep going as if the connection had not dropped?
Or is there a better approach?
These failures happen on just a simple single-node setup with a total data
set less than half the size of Java heap space, e.g. 2GB data (times two
for the two copies during cycling) versus 8GB heap. We tried reducing
memtable_flush_queue_size to 2 so that it would flush the deletes faster,
and also tried multithreaded_compaction=true, but still pycassa gets
connection failures.
Is this expected before for shedding load? Or is this unexpected?
Would things be any different if we used multiple nodes and scaled the
data and worker count to match? I mean, is there something inherent to
cassandra's operating model that makes it want to always have multiple
nodes?
Thanks for pointers,
John
Re: pycassa failures in large batch cycling
Posted by "John R. Frank" <jr...@mit.edu>.
> IMHO you are going to have more success breaking up your work load to
> work with the current settings. The buffers created by thrift are going
> to eat up the server side memory. They grow dynamically but persist for
> the life of the connection.
Amen to that. Already refactoring our workload to minimize record sizes.
Smaller fields means more of them, so batched inserts are even more useful
compared to many unbatched inserts.
IMO there is still a serious bug: even with smaller individual records, it
is trivially easy to put too many small records into a batch_mutate.
Right now, clients like pycassa, and I imagine others, are forced into an
infinite retry loop under the hood because the thrift exception is
indistinguishable from the server crashing --- the application layer has
no recourse.
I'd love to see a work around that still has the benefit of "grouping
together" many inserts.
John
Re: pycassa failures in large batch cycling
Posted by aaron morton <aa...@thelastpickle.com>.
IMHO you are going to have more success breaking up your work load to work with the current settings.
The buffers created by thrift are going to eat up the server side memory. They grow dynamically but persist for the life of the connection.
Cheers
-----------------
Aaron Morton
Freelance Cassandra Consultant
New Zealand
@aaronmorton
http://www.thelastpickle.com
On 17/05/2013, at 3:09 PM, John R. Frank <jr...@mit.edu> wrote:
> On Tue, 14 May 2013, aaron morton wrote:
>
>> After several cycles, pycassa starts getting connection failures.
>> Do you have the error stack ?Are the TimedOutExceptions or socket time outs or something else.
>
>
> I figured out the problem here and made this ticket in jira:
>
> https://issues.apache.org/jira/browse/CASSANDRA-5575
>
>
> Summary: the Thrift interfaces to Cassandra are simply not able to load large batches without putting the client into an infinite retry loop.
>
> Seems that the only robust solutions involve either features added to Thrift and all Cassandra clients, or a new interface mechanism.
>
> jrf
Re: pycassa failures in large batch cycling
Posted by "John R. Frank" <jr...@mit.edu>.
On Tue, 14 May 2013, aaron morton wrote:
> After several cycles, pycassa starts getting connection failures.
>
> Do you have the error stack ?Are the TimedOutExceptions or socket time
> outs or something else.
I figured out the problem here and made this ticket in jira:
https://issues.apache.org/jira/browse/CASSANDRA-5575
Summary: the Thrift interfaces to Cassandra are simply not able to load
large batches without putting the client into an infinite retry loop.
Seems that the only robust solutions involve either features added to
Thrift and all Cassandra clients, or a new interface mechanism.
jrf
Re: pycassa failures in large batch cycling
Posted by aaron morton <aa...@thelastpickle.com>.
> After several cycles, pycassa starts getting connection failures.
Do you have the error stack ?
Are the TimedOutExceptions or socket time outs or something else.
> Would things be any different if we used multiple nodes and scaled the data and worker count to match? I mean, is there something inherent to cassandra's operating model that makes it want to always have multiple nodes?
It's not expected. If I had to guess I would say the 100MB rows are causing some GC problems (check the cass log) and you are getting timeouts from that.
As a work around what happens when you reduce the number of workers ?
Consider smoothing out the row size by chunking them into several rows, see the Astynax client recipes for a design pattern.
Cheers
-----------------
Aaron Morton
Freelance Cassandra Consultant
New Zealand
@aaronmorton
http://www.thelastpickle.com
On 10/05/2013, at 1:09 PM, John R. Frank <jr...@mit.edu> wrote:
> C* users,
>
> We have a process that loads a large batch of rows from Cassandra into many separate compute workers. The rows are one-column wide and range in size for a couple KB to ~100 MB. After manipulating the data for a while, each compute worker writes the data back with *new* row keys computed by the workers (UUIDs).
>
> After the full batch is written back to new rows, a cleanup worker deletes the old rows.
>
> After several cycles, pycassa starts getting connection failures.
>
> Should we use a pycassa listener to catch these failures and just recreate the ConnectionPool and keep going as if the connection had not dropped? Or is there a better approach?
>
> These failures happen on just a simple single-node setup with a total data set less than half the size of Java heap space, e.g. 2GB data (times two for the two copies during cycling) versus 8GB heap. We tried reducing memtable_flush_queue_size to 2 so that it would flush the deletes faster, and also tried multithreaded_compaction=true, but still pycassa gets connection failures.
>
> Is this expected before for shedding load? Or is this unexpected?
>
> Would things be any different if we used multiple nodes and scaled the data and worker count to match? I mean, is there something inherent to cassandra's operating model that makes it want to always have multiple nodes?
>
> Thanks for pointers,
> John