Ray

Results 167 comments of Ray

另外,server端1W个链接都是rpc的?client端使用的netty4模块吗?netty4模块比较适合链接数较小的场景,client端可以只针对qps较高的service设置最少链接数。比如minClientConnection=5

建议 1. 升级到最新版本1.1.3 2. 把netty升级到netty4。方法:把pom依赖中的`motan-transport-netty`改为`motan-transport-netty4` 3. client端把请求量大的service配置`minClientConnection=5`,请求量小的service配置`minClientConnection=2`。 样例如下,不同的服务引用不同的basicreferer就可以了 ```xml ```

一般可以根据业务隔离性来规划,例如核心服务与非核心服务使用不同端口

The heartbeat mechanism in Motan is only used to probe [unavailable server nodes](https://github.com/weibocom/motan/blob/6f5d04f30f3eeaab853ecbd7b4c5d6201bc01c91/motan-transport-netty/src/main/java/com/weibo/api/motan/transport/netty/NettyClient.java#L356), not to maintain link validity. The TCP KeepAlive mechanism is used to do this,so the net.ipv4.tcp_keepalive_time=1200 will...

Yes, you can use the `motan-transport-netty4` if you restart the service instance when the vip is stwiched. The channel will be rebuilt as soon as the link has been broken....

Sorry, the `fusingThreshold` is currently not configurable yet, it will be available in subsequent releases. In motan 0.2.3, the fusingThreshold is equals to maxClientConnection. [This exception log](https://github.com/weibocom/motan/blob/6f5d04f30f3eeaab853ecbd7b4c5d6201bc01c91/motan-transport-netty/src/main/java/com/weibo/api/motan/transport/netty/NettyClient.java#L163) will be printed...

不支持file,如果需要传输文件的话,建议使用byte[]作为参数

要对链接进行限制需要在链接建立时进行,目前没有提供对应的扩展点。 如果要实现这样的功能,可以考虑类似`NettyEndpointFactory`类实现`EndpointFactory`扩展点,可以对nettyserver的messagehandler进行封装,增加验证逻辑

我测试一下,如果不支持的话我们会考虑支持。 你可以试一下用direct注册中心,效果和使用directUrl是一样的。在client端增加注册中心配置,然后在refer中指定对应注册中心。

建议在你实现的FutureListener中使用独立线程池进行异步调用,netty io线程数量有限,只适合做一些简单操作,不宜进行远程调用等重量级的操作