Finding out Netty Client's throughput

25 views
Skip to first unread message

Khayam Gondal

unread,
May 16, 2018, 8:16:46 PM5/16/18
to Netty discussions

I have above setup. A 3rd party client is sending traffic over 10G link to my netty server and I have to forward it over a 1G link using Netty client. As I can't write very fast, I also need to adjust my read speed. Is there anyway using Netty's API to find out how fast my channel is capable of sending so I can adjust my read server bandwidth.




Norman Maurer

unread,
May 17, 2018, 1:48:00 AM5/17/18
to ne...@googlegroups.com
Hey,

Usually you would use channelWritabilityChanged events to do this.

Set your WriteBufferWaterMark when bootstrap your Channel and then add a ChannelInboundHandler that implements channelWritabilityChanged(…). Depending on if Channel.isWritable() you can either stop or start reading again by either trigger Channel.config().setAutoRead(false|true). Or if you want to be even more flexible you can configure the Channel to not use auto-read at all and manage the calls to Channel.read() by yourself.

Hope this helps,
Norman


On 12. May 2018, at 16:10, Khayam Gondal <khayam...@gmail.com> wrote:

I have above setup. A 3rd party client is sending traffic over 10G link to my netty server and I have to forward it over a 1G link using Netty client. As I can't write very fast, I also need to adjust my read speed. Is there anyway using Netty's API to find out how fast my channel is capable of sending so I can adjust my read server bandwidth.





--
You received this message because you are subscribed to the Google Groups "Netty discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to netty+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/netty/b295b9e4-bd5b-4074-8f85-466573f700e5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages