You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@dubbo.apache.org by 大步流星 <83...@qq.com> on 2018/11/09 02:43:02 UTC

回复: dubbo使用中的疑问

Generally, it is not recommended to set connections in the provider, so it is easy to connect to the storm when there are too many upstream consumers, so we generally set the connection limit (that is, accepts) in the provider, and the number of connections can be set on the consumer side as needed.


一般不太建议在provider设置connections,这样在上游consumer太多时容易连接风暴,所以我们一般在provider设置连接上限(即accepts),而在consumer端可以根据需要设置connections数量




------------------ 原始邮件 ------------------
发件人: "Ian Luo"<ia...@gmail.com>;
发送时间: 2018年11月9日(星期五) 上午10:37
收件人: "dev"<de...@dubbo.apache.org>;
抄送: "dev"<de...@dubbo.incubator.apache.org>; 
主题: Re: dubbo使用中的疑问



+1, total agree with Jason's suggestion.

On Fri, Nov 9, 2018 at 5:16 AM Jason Joo <hb...@163.com> wrote:

> Hi,
>
> 设置connection属性要慎重,建议从1起,因为对于connection=N,每个设置了该属性的项目会在连provider时每个provider除已连接的共用连接外均新建N个连接,也就是最终每个consumer是N
> * n,对于每个provider则是N * m
>
> 其中,
> n - provider数
> m - 消费数
>
> 另外由于method/service均可设置该属性,多个属性会叠加这个问题
>
> best regards,
>
> Jason
>
> > On Nov 8, 2018, at 11:54, Zonghai Shang <yi...@apache.org> wrote:
> >
> > Hi,
> >
> > 麻烦图片重新发下,这边看不到图片。
> >
> > 1. dubbo默认多个请求会复用同一个tcp连接,所以只有一个NettyServerWork去处理client
> > io事件,netty模型会把chanel绑定到eventloop,一旦绑定永远不会改变。
> >
> > 2. 你可以增加client端连接数,比如connections=3 或者4,5,然后再观察。
> >
> > 备注: netty服务端默认会把tcp连接公平分发给children eventloop。
> >
> > -yiji
> >
> > 噬音 <40...@qq.com> 于2018年11月7日周三 下午7:29写道:
> >
> >> 你们好
> >>   我在使用过程中有个疑问,请在百忙中抽空解答一下:
> >>
> 官网说明iothreads默认是cpu个数+1,从线程栈中看到有1个NettyClientWoker、3个NettyServerWork和1个NettyServerBoss线程;在服务运行过程中,看到NettyClientWoker和其中一个NettyServerWork线程是有CPU负载的,按照Netty框架,通过Boss线程去select
> >>
> work线程,然后work去run,应该三个NettyServerWork线程cpu使用率应该是相近的;为什么只有一个NettyServerWork
> >> cpu负载高,其它的两个线程NettyServerWork几乎看不到cpu负载(线程状态都是RUNNABLE的)?
> >>
> >> PS:使用的是4核cpu的服务器,dubbo版本号2.6.2,dubbo使用默认配置
> >>
> >>
> >>
> >>
>
>