You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2021/07/06 12:25:17 UTC
[GitHub] [servicecomb-java-chassis] jussssss opened a new issue #2454: 部署RestServerVerticle时不能充分利用所有EventLoop线程
jussssss opened a new issue #2454:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2454
1)应用启动,部署RestServerVerticle阶段,框架默认设置了WorkerPoolName、WorkerPoolSize。

2)部署Verticle实例的逻辑中,会根据WorkerPoolName是否为空来决定是否创建WorkerExecutor。创建WorkerExecutor时,会从vertx对象获取ContextImpl,并把WorkerExecutor加入到ContextImpl的CloseHooks中。
3)部署Verticle实例的逻辑中,会再次从vertx对象获取ContextImpl,用来执行Verticle实例的init和start逻辑,将Verticle实例和ContextImpl(EventLoop线程)绑定。

4)以上逻辑都在main主线程执行,而在主线程中,每次从vertx对象获取ContextImpl,实际上是遍历一个EventLoopGroup成员。

也就是说,每部署一个RestServerVerticle实例,EventLoopGroup成员被遍历两个,RestServerVerticle实例与EventLoop实例的绑定关系大概是:RestServerVerticle-0绑定EventLoop-1、RestServerVerticle-2绑定EventLoop-3、RestServerVerticle-3绑定EventLoop-5……。
框架未开放EventLoopGroupSize配置,默认值是cpucore*2,一定是偶数,因此无论将RestServerVerticle实例数设置为多少,所有RestServerVerticle实例都只能绑定到一半的EventLoop线程,无法充分利用所有EventLoop线程,无法充分利用所有cpucore。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2454: 部署RestServerVerticle时不能充分利用所有EventLoop线程
Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2454:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2454#issuecomment-875337431
`每部署一个RestServerVerticle实例,EventLoopGroup成员被遍历两个,RestServerVerticle实例与EventLoop实例的绑定关系大概是:RestServerVerticle-0绑定EventLoop-1、RestServerVerticle-2绑定EventLoop-3、RestServerVerticle-3绑定EventLoop-5`
意思是vert.x绑定eventloop线程的逻辑有问题? 还是说这个逻辑是正确的,必须保证使用基数的eventloop线程数?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] wujimin commented on issue #2454: 部署RestServerVerticle时不能充分利用所有EventLoop线程
Posted by GitBox <gi...@apache.org>.
wujimin commented on issue #2454:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2454#issuecomment-875181619
如果是这样的,确实与期望的不符,需要确认一下
@liubao68 看一下?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] jussssss commented on issue #2454: 部署RestServerVerticle时不能充分利用所有EventLoop线程
Posted by GitBox <gi...@apache.org>.
jussssss commented on issue #2454:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2454#issuecomment-875463975
vertx issue https://github.com/eclipse-vertx/vert.x/issues/4006
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2454: 部署RestServerVerticle时不能充分利用所有EventLoop线程
Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2454:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2454#issuecomment-894033256
alreay updated to vert.x 4
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] jussssss commented on issue #2454: 部署RestServerVerticle时不能充分利用所有EventLoop线程
Posted by GitBox <gi...@apache.org>.
jussssss commented on issue #2454:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2454#issuecomment-875388708
看起来是vert.x的逻辑有问题,在一次部署Verticle逻辑里,WorkerExecutor被两次添加到不同的Context的CloseHook里。
https://stackoverflow.com/questions/63466734/how-does-vertx-create-eventloop-thread
找到一个相同的问题,但没有结论。准备给vert.x提个issue。
我觉得chassis框架目前可以做的是开放WorkerPool配置,把是否需要WorkerPool及WorkerPoolSize交给业务控制。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] liubao68 commented on issue #2454: 部署RestServerVerticle时不能充分利用所有EventLoop线程
Posted by GitBox <gi...@apache.org>.
liubao68 commented on issue #2454:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2454#issuecomment-876037755
我们正在计划升级vert.x 4. 但是在等待netty的版本,vert.x依赖了netty 4.1.6x版本, 目前netty的6x版本有些功能性问题,还不敢集成。
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] liubao68 closed issue #2454: 部署RestServerVerticle时不能充分利用所有EventLoop线程
Posted by GitBox <gi...@apache.org>.
liubao68 closed issue #2454:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2454
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [servicecomb-java-chassis] wujimin commented on issue #2454: 部署RestServerVerticle时不能充分利用所有EventLoop线程
Posted by GitBox <gi...@apache.org>.
wujimin commented on issue #2454:
URL: https://github.com/apache/servicecomb-java-chassis/issues/2454#issuecomment-875356916
我一直以为是连续的
如果当前eventloop已经分配到了1(第一个为0),共有4个eventloop,此时需要创建4个verticle,期望是2/3/0/1
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org