Encoder for binary protocol

David Alves davidralves at gmail.com
Thu Nov 18 14:06:20 EST 2010


Hi David

	The rate you are getting is strangely low.
	For reference I'm using a binary protocol also, I use frame decoder, my messages are typically in the 100 byte range and I typically get 120.000 msg/sec on my dev laptop (a flooded m1.large ec2 instance handles up to 400.000). On top of that I have tcpnodelay on and flush the client buffers every 1000 tuples. 
	So my suspicion is that there's something wrong with your implementation, of course it is impossible to say without actually looking at the code.

Regards
David




On Nov 17, 2010, at 4:53 PM, netty20101117 wrote:

> 
> Hi,
> I am implementing a binary protocol with an 8 byte header, following by a
> message body.
> Message length is total length of message
> 
> 
>            0              1              2              3
>     +--------------+--------------+--------------+--------------+
>     |Version       |    Op Code   |       Client-info           |
>     +--------------+--------------+--------------+--------------+
>     |                      Message Length                       |
>     +--------------+--------------+--------------+--------------+
> 
> Header is 8 bytes
> 
> Version: 8 bits
> Op Code: 8 bits
> Client-info: 16 bits
> Message Length: 32 bits
> 
> Opcode encoded as follows
> 1 = Request        (REQ)
> 2 = Response       (RES)
> 3 = Client-Open    (OPN)
> 4 = Client-Accept  (CAT)
> 5 = Client-Close   (CC)
> 6 = Keep-Alive     (KA)
> 
> For the encoder i extend OneToOneEncoder
> 
> For the decoder I extend FrameDecoder. At the moment I am only able to
> achieve a message rate of around 600-700 msgs per second. To increase
> performance
> would it be better to extend ReplayingDecoder instead ? Typically received
> messages are between 120 & 200 bytes in length
> 
> Any help appreciated
> Thanks
> David
> -- 
> View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Encoder-for-binary-protocol-tp5332889p5748507.html
> Sent from the Netty User Group mailing list archive at Nabble.com.
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users




More information about the netty-users mailing list