How to allow more concurrent client connections with Netty?

旧城冷巷雨未停 提交于 2019-12-04 05:03:27
Jestan Nirojan

1) You can tweak the connectTimeout in the client bootstrap to make sure there is no network/server issues

clientBootStrap.setOption("connectTimeoutMillis", optimumTimout);

2) By setting the backlog value in the Netty server, you can increase the queue of incoming connection size, so clients will have better chance of connecting to the server

serverBootStrap.setOption("backlog", 1000);

3) You have said that your application is creating many connections simultaneously, Client Boss thread may lag behind, if the application is connecting too fast.

Netty 3.2.7 Final allows to set more than one Client Boss thread in NioClientSocketChannelFactory constructor to avoid this issue.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!