You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@cassandra.apache.org by Greg Hinkle <gr...@gmail.com> on 2011/09/23 05:16:21 UTC

MessagingService.sendOneWay sending blank bytes?

I noticed that on the 0.8 branch the implementation of MessagingService.sendOneWay is building up a DataOutputBuffer with a default size of 128 bytes, but then sending it as the full buffer no matter how many bytes the the data takes. I believe it should be calling DataOutputBuffer.asByteArray() or copying just up to the length() into the ByteBuffer. This means it appears to be wasting on around 40 to 80 bytes on every message. This really adds up in a big cluster.

It looks like things are different in trunk, but can anyone confirm this bug in 0.8? Thanks. 


Greg Hinkle


Re: MessagingService.sendOneWay sending blank bytes?

Posted by Jonathan Ellis <jb...@gmail.com>.
The full backport is beyond the scope of what I'm comfortable in a
stable release series, but the asByteArray fix sounds reasonable to
me.  Can you create a ticket + patch?

On Fri, Sep 23, 2011 at 8:04 AM, Greg Hinkle <gr...@gmail.com> wrote:
> Is it worth a back-port or at least switch to asByteArray for 0.8.7? It's a sizable amount of wasted network traffic and the fix seems pretty safe. (It's working for me)
>
> Greg Hinkle
>
> On Sep 23, 2011, at 3:32 AM, Jonathan Ellis wrote:
>
>> Yes.  This is one of the things fixed for 1.0 in
>> https://issues.apache.org/jira/browse/CASSANDRA-1788
>>
>> On Thu, Sep 22, 2011 at 11:16 PM, Greg Hinkle <gr...@gmail.com> wrote:
>>> I noticed that on the 0.8 branch the implementation of MessagingService.sendOneWay is building up a DataOutputBuffer with a default size of 128 bytes, but then sending it as the full buffer no matter how many bytes the the data takes. I believe it should be calling DataOutputBuffer.asByteArray() or copying just up to the length() into the ByteBuffer. This means it appears to be wasting on around 40 to 80 bytes on every message. This really adds up in a big cluster.
>>>
>>> It looks like things are different in trunk, but can anyone confirm this bug in 0.8? Thanks.
>>>
>>>
>>> Greg Hinkle
>>>
>>>
>>
>>
>>
>> --
>> Jonathan Ellis
>> Project Chair, Apache Cassandra
>> co-founder of DataStax, the source for professional Cassandra support
>> http://www.datastax.com
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com

Re: MessagingService.sendOneWay sending blank bytes?

Posted by Greg Hinkle <gr...@gmail.com>.
Is it worth a back-port or at least switch to asByteArray for 0.8.7? It's a sizable amount of wasted network traffic and the fix seems pretty safe. (It's working for me)

Greg Hinkle

On Sep 23, 2011, at 3:32 AM, Jonathan Ellis wrote:

> Yes.  This is one of the things fixed for 1.0 in
> https://issues.apache.org/jira/browse/CASSANDRA-1788
> 
> On Thu, Sep 22, 2011 at 11:16 PM, Greg Hinkle <gr...@gmail.com> wrote:
>> I noticed that on the 0.8 branch the implementation of MessagingService.sendOneWay is building up a DataOutputBuffer with a default size of 128 bytes, but then sending it as the full buffer no matter how many bytes the the data takes. I believe it should be calling DataOutputBuffer.asByteArray() or copying just up to the length() into the ByteBuffer. This means it appears to be wasting on around 40 to 80 bytes on every message. This really adds up in a big cluster.
>> 
>> It looks like things are different in trunk, but can anyone confirm this bug in 0.8? Thanks.
>> 
>> 
>> Greg Hinkle
>> 
>> 
> 
> 
> 
> -- 
> Jonathan Ellis
> Project Chair, Apache Cassandra
> co-founder of DataStax, the source for professional Cassandra support
> http://www.datastax.com


Re: MessagingService.sendOneWay sending blank bytes?

Posted by Jonathan Ellis <jb...@gmail.com>.
Yes.  This is one of the things fixed for 1.0 in
https://issues.apache.org/jira/browse/CASSANDRA-1788

On Thu, Sep 22, 2011 at 11:16 PM, Greg Hinkle <gr...@gmail.com> wrote:
> I noticed that on the 0.8 branch the implementation of MessagingService.sendOneWay is building up a DataOutputBuffer with a default size of 128 bytes, but then sending it as the full buffer no matter how many bytes the the data takes. I believe it should be calling DataOutputBuffer.asByteArray() or copying just up to the length() into the ByteBuffer. This means it appears to be wasting on around 40 to 80 bytes on every message. This really adds up in a big cluster.
>
> It looks like things are different in trunk, but can anyone confirm this bug in 0.8? Thanks.
>
>
> Greg Hinkle
>
>



-- 
Jonathan Ellis
Project Chair, Apache Cassandra
co-founder of DataStax, the source for professional Cassandra support
http://www.datastax.com