Re: dubbo使用中的疑问

2018-11-09 Thread Jason Joo
啊,抱歉,那可能是记错了method的属性集。

之前老版本的xsd貌似会有多余的自动提示,只测试过多个service同时设置connections时的情况(为了解决100倍以上的小尖峰问题)。

其实关于单连接模型,这个是有什么约束的吗?是否有可能设置为数量N(default=1)的长连接池,全局均可受惠。

best regards,

Jason

> On Nov 9, 2018, at 11:19, yuhang xiu  wrote:
> 
>> 
>>> 另外由于method/service均可设置该属性,多个属性会叠加这个问题
>> 我对着保持怀疑态度,晚点我会仔细check一下
> 
> 
> 我也对这个存疑,目前来看method的connections属性对整体的连接数影响我还没有发现。测试了一下发现method设置的connections不会起作用。
> 
> Zonghai Shang  于2018年11月9日周五 上午11:16写道:
> 
>> Hi,
>> 
>>> 另外由于method/service均可设置该属性,多个属性会叠加这个问题
>> 
>> 我对着保持怀疑态度,晚点我会仔细check一下
>> 
>> -yiji
>> 
>> Zonghai Shang  于2018年11月9日周五 上午10:46写道:
>> 
>>> Hi,
>>> 
>>> 
>>> 
>> dubbo默认值会复用建立的1个tcp连接,nettyServerBootstrapAcceptor会监听到,会用其中一个childgroup和这个channel做绑定,其他eventloop只会空轮训,绑定的channel线程会读写数据,没有理解哪里有问题。
>>> 
 最终每个consumer是N * n,对于每个provider则是N * m
>>> 
>>> 
>> 我这里针对他的问题,提供建议,让他增大连接数验证,netty收到同一个client多个channel连接一定会均衡绑定eventloop(默认策略)。
>>> 
>>> -yiji
>>> 
>>> Ian Luo  于2018年11月9日周五 上午10:37写道:
>>> 
 +1, total agree with Jason's suggestion.
 
 On Fri, Nov 9, 2018 at 5:16 AM Jason Joo  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  wrote:
>> 
>> Hi,
>> 
>> 麻烦图片重新发下,这边看不到图片。
>> 
>> 1. dubbo默认多个请求会复用同一个tcp连接,所以只有一个NettyServerWork去处理client
>> io事件,netty模型会把chanel绑定到eventloop,一旦绑定永远不会改变。
>> 
>> 2. 你可以增加client端连接数,比如connections=3 或者4,5,然后再观察。
>> 
>> 备注: netty服务端默认会把tcp连接公平分发给children eventloop。
>> 
>> -yiji
>> 
>> 噬音 <402264...@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使用默认配置
>>> 
>>> 
>>> 
>>> 
> 
> 
 
>>> 
>> 



Re: dubbo使用中的疑问

2018-11-09 Thread yuhang xiu
Hi

I have submit a related issue[1] for discussing the connections setting on
method.
Looking forward to your opinions.

[1]https://github.com/apache/incubator-dubbo/issues/2769

Ian Luo  于2018年11月9日周五 上午11:29写道:

> google translation for yiji's reply:
>
> Dubbo default value will be reused to establish a tcp connection,
> nettyServerBootstrapAcceptor will listen, will use one of the childgroup
> and this channel to do the binding, other eventloop will only empty
> training, the bound channel thread will read and write data, no
> understanding where has a problem.
>
> > Finally each consumer is N * n, for each provider it is N * m
>
> I am here to provide suggestions for his problems, let him increase the
> connection number verification, netty receives multiple channel connections
> of the same client will be balanced binding eventloop (default policy).
>
> On Fri, Nov 9, 2018 at 10:47 AM Zonghai Shang  wrote:
>
> > Hi,
> >
> >
> >
> dubbo默认值会复用建立的1个tcp连接,nettyServerBootstrapAcceptor会监听到,会用其中一个childgroup和这个channel做绑定,其他eventloop只会空轮训,绑定的channel线程会读写数据,没有理解哪里有问题。
> >
> > > 最终每个consumer是N * n,对于每个provider则是N * m
> >
> >
> 我这里针对他的问题,提供建议,让他增大连接数验证,netty收到同一个client多个channel连接一定会均衡绑定eventloop(默认策略)。
> >
> > -yiji
> >
> > Ian Luo  于2018年11月9日周五 上午10:37写道:
> >
> > > +1, total agree with Jason's suggestion.
> > >
> > > On Fri, Nov 9, 2018 at 5:16 AM Jason Joo  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  wrote:
> > > > >
> > > > > Hi,
> > > > >
> > > > > 麻烦图片重新发下,这边看不到图片。
> > > > >
> > > > > 1. dubbo默认多个请求会复用同一个tcp连接,所以只有一个NettyServerWork去处理client
> > > > > io事件,netty模型会把chanel绑定到eventloop,一旦绑定永远不会改变。
> > > > >
> > > > > 2. 你可以增加client端连接数,比如connections=3 或者4,5,然后再观察。
> > > > >
> > > > > 备注: netty服务端默认会把tcp连接公平分发给children eventloop。
> > > > >
> > > > > -yiji
> > > > >
> > > > > 噬音 <402264...@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使用默认配置
> > > > >>
> > > > >>
> > > > >>
> > > > >>
> > > >
> > > >
> > >
> >
>


Re: dubbo使用中的疑问

2018-11-08 Thread Ian Luo
google translation for yiji's reply:

Dubbo default value will be reused to establish a tcp connection,
nettyServerBootstrapAcceptor will listen, will use one of the childgroup
and this channel to do the binding, other eventloop will only empty
training, the bound channel thread will read and write data, no
understanding where has a problem.

> Finally each consumer is N * n, for each provider it is N * m

I am here to provide suggestions for his problems, let him increase the
connection number verification, netty receives multiple channel connections
of the same client will be balanced binding eventloop (default policy).

On Fri, Nov 9, 2018 at 10:47 AM Zonghai Shang  wrote:

> Hi,
>
>
> dubbo默认值会复用建立的1个tcp连接,nettyServerBootstrapAcceptor会监听到,会用其中一个childgroup和这个channel做绑定,其他eventloop只会空轮训,绑定的channel线程会读写数据,没有理解哪里有问题。
>
> > 最终每个consumer是N * n,对于每个provider则是N * m
>
> 我这里针对他的问题,提供建议,让他增大连接数验证,netty收到同一个client多个channel连接一定会均衡绑定eventloop(默认策略)。
>
> -yiji
>
> Ian Luo  于2018年11月9日周五 上午10:37写道:
>
> > +1, total agree with Jason's suggestion.
> >
> > On Fri, Nov 9, 2018 at 5:16 AM Jason Joo  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  wrote:
> > > >
> > > > Hi,
> > > >
> > > > 麻烦图片重新发下,这边看不到图片。
> > > >
> > > > 1. dubbo默认多个请求会复用同一个tcp连接,所以只有一个NettyServerWork去处理client
> > > > io事件,netty模型会把chanel绑定到eventloop,一旦绑定永远不会改变。
> > > >
> > > > 2. 你可以增加client端连接数,比如connections=3 或者4,5,然后再观察。
> > > >
> > > > 备注: netty服务端默认会把tcp连接公平分发给children eventloop。
> > > >
> > > > -yiji
> > > >
> > > > 噬音 <402264...@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使用默认配置
> > > >>
> > > >>
> > > >>
> > > >>
> > >
> > >
> >
>


Re: dubbo使用中的疑问

2018-11-08 Thread yuhang xiu
>
> > 另外由于method/service均可设置该属性,多个属性会叠加这个问题
> 我对着保持怀疑态度,晚点我会仔细check一下


我也对这个存疑,目前来看method的connections属性对整体的连接数影响我还没有发现。测试了一下发现method设置的connections不会起作用。

Zonghai Shang  于2018年11月9日周五 上午11:16写道:

> Hi,
>
> > 另外由于method/service均可设置该属性,多个属性会叠加这个问题
>
> 我对着保持怀疑态度,晚点我会仔细check一下
>
> -yiji
>
> Zonghai Shang  于2018年11月9日周五 上午10:46写道:
>
> > Hi,
> >
> >
> >
> dubbo默认值会复用建立的1个tcp连接,nettyServerBootstrapAcceptor会监听到,会用其中一个childgroup和这个channel做绑定,其他eventloop只会空轮训,绑定的channel线程会读写数据,没有理解哪里有问题。
> >
> > > 最终每个consumer是N * n,对于每个provider则是N * m
> >
> >
> 我这里针对他的问题,提供建议,让他增大连接数验证,netty收到同一个client多个channel连接一定会均衡绑定eventloop(默认策略)。
> >
> > -yiji
> >
> > Ian Luo  于2018年11月9日周五 上午10:37写道:
> >
> >> +1, total agree with Jason's suggestion.
> >>
> >> On Fri, Nov 9, 2018 at 5:16 AM Jason Joo  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  wrote:
> >> > >
> >> > > Hi,
> >> > >
> >> > > 麻烦图片重新发下,这边看不到图片。
> >> > >
> >> > > 1. dubbo默认多个请求会复用同一个tcp连接,所以只有一个NettyServerWork去处理client
> >> > > io事件,netty模型会把chanel绑定到eventloop,一旦绑定永远不会改变。
> >> > >
> >> > > 2. 你可以增加client端连接数,比如connections=3 或者4,5,然后再观察。
> >> > >
> >> > > 备注: netty服务端默认会把tcp连接公平分发给children eventloop。
> >> > >
> >> > > -yiji
> >> > >
> >> > > 噬音 <402264...@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使用默认配置
> >> > >>
> >> > >>
> >> > >>
> >> > >>
> >> >
> >> >
> >>
> >
>


Re: dubbo使用中的疑问

2018-11-08 Thread Zonghai Shang
Hi,

> 另外由于method/service均可设置该属性,多个属性会叠加这个问题

我对着保持怀疑态度,晚点我会仔细check一下

-yiji

Zonghai Shang  于2018年11月9日周五 上午10:46写道:

> Hi,
>
>
> dubbo默认值会复用建立的1个tcp连接,nettyServerBootstrapAcceptor会监听到,会用其中一个childgroup和这个channel做绑定,其他eventloop只会空轮训,绑定的channel线程会读写数据,没有理解哪里有问题。
>
> > 最终每个consumer是N * n,对于每个provider则是N * m
>
> 我这里针对他的问题,提供建议,让他增大连接数验证,netty收到同一个client多个channel连接一定会均衡绑定eventloop(默认策略)。
>
> -yiji
>
> Ian Luo  于2018年11月9日周五 上午10:37写道:
>
>> +1, total agree with Jason's suggestion.
>>
>> On Fri, Nov 9, 2018 at 5:16 AM Jason Joo  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  wrote:
>> > >
>> > > Hi,
>> > >
>> > > 麻烦图片重新发下,这边看不到图片。
>> > >
>> > > 1. dubbo默认多个请求会复用同一个tcp连接,所以只有一个NettyServerWork去处理client
>> > > io事件,netty模型会把chanel绑定到eventloop,一旦绑定永远不会改变。
>> > >
>> > > 2. 你可以增加client端连接数,比如connections=3 或者4,5,然后再观察。
>> > >
>> > > 备注: netty服务端默认会把tcp连接公平分发给children eventloop。
>> > >
>> > > -yiji
>> > >
>> > > 噬音 <402264...@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使用默认配置
>> > >>
>> > >>
>> > >>
>> > >>
>> >
>> >
>>
>


Re: dubbo使用中的疑问

2018-11-08 Thread Zonghai Shang
Hi,

dubbo默认值会复用建立的1个tcp连接,nettyServerBootstrapAcceptor会监听到,会用其中一个childgroup和这个channel做绑定,其他eventloop只会空轮训,绑定的channel线程会读写数据,没有理解哪里有问题。

> 最终每个consumer是N * n,对于每个provider则是N * m

我这里针对他的问题,提供建议,让他增大连接数验证,netty收到同一个client多个channel连接一定会均衡绑定eventloop(默认策略)。

-yiji

Ian Luo  于2018年11月9日周五 上午10:37写道:

> +1, total agree with Jason's suggestion.
>
> On Fri, Nov 9, 2018 at 5:16 AM Jason Joo  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  wrote:
> > >
> > > Hi,
> > >
> > > 麻烦图片重新发下,这边看不到图片。
> > >
> > > 1. dubbo默认多个请求会复用同一个tcp连接,所以只有一个NettyServerWork去处理client
> > > io事件,netty模型会把chanel绑定到eventloop,一旦绑定永远不会改变。
> > >
> > > 2. 你可以增加client端连接数,比如connections=3 或者4,5,然后再观察。
> > >
> > > 备注: netty服务端默认会把tcp连接公平分发给children eventloop。
> > >
> > > -yiji
> > >
> > > 噬音 <402264...@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使用默认配置
> > >>
> > >>
> > >>
> > >>
> >
> >
>


Re: dubbo使用中的疑问

2018-11-08 Thread Ian Luo
+1, total agree with Jason's suggestion.

On Fri, Nov 9, 2018 at 5:16 AM Jason Joo  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  wrote:
> >
> > Hi,
> >
> > 麻烦图片重新发下,这边看不到图片。
> >
> > 1. dubbo默认多个请求会复用同一个tcp连接,所以只有一个NettyServerWork去处理client
> > io事件,netty模型会把chanel绑定到eventloop,一旦绑定永远不会改变。
> >
> > 2. 你可以增加client端连接数,比如connections=3 或者4,5,然后再观察。
> >
> > 备注: netty服务端默认会把tcp连接公平分发给children eventloop。
> >
> > -yiji
> >
> > 噬音 <402264...@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使用默认配置
> >>
> >>
> >>
> >>
>
>


Re: dubbo使用中的疑问

2018-11-08 Thread Jason Joo
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  wrote:
> 
> Hi,
> 
> 麻烦图片重新发下,这边看不到图片。
> 
> 1. dubbo默认多个请求会复用同一个tcp连接,所以只有一个NettyServerWork去处理client
> io事件,netty模型会把chanel绑定到eventloop,一旦绑定永远不会改变。
> 
> 2. 你可以增加client端连接数,比如connections=3 或者4,5,然后再观察。
> 
> 备注: netty服务端默认会把tcp连接公平分发给children eventloop。
> 
> -yiji
> 
> 噬音 <402264...@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使用默认配置
>> 
>> 
>> 
>> 



Re: dubbo使用中的疑问

2018-11-08 Thread Ian Luo
应该不会这样。

com.alibaba.dubbo.remoting.transport.netty.NettyServer#doOpen:

ChannelFactory channelFactory = new NioServerSocketChannelFactory(boss,
worker, getUrl().getPositiveParameter(Constants.IO_THREADS_KEY,
Constants.DEFAULT_IO_THREADS));

你时间跑的够不够长?还有你的截图我看不到,能否放在你的 github 上?

On Wed, Nov 7, 2018 at 7:30 PM 噬音 <402264...@qq.com> wrote:

> 你们好
>我在使用过程中有个疑问,请在百忙中抽空解答一下:
> 官网说明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使用默认配置
>
>
>
>


Re: dubbo使用中的疑问

2018-11-07 Thread Zonghai Shang
Hi,

麻烦图片重新发下,这边看不到图片。

1. dubbo默认多个请求会复用同一个tcp连接,所以只有一个NettyServerWork去处理client
io事件,netty模型会把chanel绑定到eventloop,一旦绑定永远不会改变。

2. 你可以增加client端连接数,比如connections=3 或者4,5,然后再观察。

备注: netty服务端默认会把tcp连接公平分发给children eventloop。

-yiji

噬音 <402264...@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使用默认配置
>
>
>
>