Reputation: 41
how to achieve high throughput server with netty4?
The package is small about 16byte~0.5K, tps about 8.8w/s in my benchmark and can not rise, are there some parameter tuning recommendations in netty4 to benifit small package?
The code is RocketMQ, It is a MQ with a self-define store structure, also use the private protocol between broker and client.
Thanks a lot.
Upvotes: 1
Views: 524
Reputation: 318
Like Norman Maurer said in his comment, without some code and profiling it is hard to help. But I'll give it a try...
Since each packet is so small, you will have a lot of overhead sending them individually, that's because of how Netty is designed. Once you send a message it goes through an entire chain (the pipeline), although helpful, it helps keeping things simple and modularised, but it quickly add up if you are sending several small sized messages.
As a solution you could try place them on a queue that gets flushed every 10 milliseconds or after 100 packets been have filled. Please note that this WILL cause a increase in latency, specially when there's only a few packets being sent.
Upvotes: 1