Repository navigation
[Dubb - epoll ] Support epoll - #2738
zonghaishang wants to merge 12 commits into
Conversation
Codecov Report
@@ Coverage Diff @@
## master #2738 +/- ##
==========================================
- Coverage 64.09% 63.96% -0.13%
==========================================
Files 584 589 +5
Lines 26059 26129 +70
Branches 4562 4569 +7
==========================================
+ Hits 16702 16714 +12
- Misses 7184 7229 +45
- Partials 2173 2186 +13
Continue to review full report at Codecov.
|
carryxyh
left a comment
There was a problem hiding this comment.
另外一个问题,epoll属性会不会透传?
按照目前的方式应该是会的,通过url会从provider透传到consumer,从而影响到consumer的epoll。
实际上感觉不透传好一些吧?
| this.epoll = isLinux() && url.getParameter(Constants.EPOLL_ENABLE, false); | ||
| } | ||
|
|
||
| public NioEventLoopGroup nioEventLoopGroup(ThreadFactory threadFactory) { |
There was a problem hiding this comment.
abstractsupport里不要放这种代码比较好吧?
nioEventLoopGroup方法其实已经具体到netty了,是不是把它放到实现里比较好。
|
针对:按照目前的方式应该是会的,通过url会从provider透传到consumer,从而影响到consumer的epoll。 epoll server支持 epoll 和 非epoll调用过来,透传给client, 如果client自动知道server支持epoll,自动适配是合适的。 |
| } | ||
| this.url = url; | ||
| this.nThreads = url.getPositiveParameter(Constants.IO_THREADS_KEY, Constants.DEFAULT_IO_THREADS); | ||
| this.epoll = isLinux() && url.getParameter(Constants.EPOLL_ENABLE, false); |
There was a problem hiding this comment.
linux system doesn't mean it support epoll. we also need check major version.
Or we can use io.netty.channel.epoll.Epoll, it has a method isAvailable
|
没仔细看,几个建议:
综上所述,看起来 Transporter 应该有一个 TransporterConfig,或者干脆在 app 级别上定义。如果想不清楚,暂时通过 system properties 指定也是可以的。Native Transport 的支持需要考虑全平台,而不是只有 linux 上的 epoll,做成 factory 模式,出错 fallback 到 nio I have a couple of suggestions after take a glance at the implementation:
In summary, we should either define 'native-transporter' on ApplicationConfig or TransporterConfig (not introduced yet). It is also reasonable to introduce it with a system property if we cannot make the decision now. For native transport support, we should consider not only epoll on linux, but also others. |
嗯,考虑了下移除protocol控制更合适,我会修复掉 |
|
+1, 之前测试过 Netty 支持的 native epoll, benchmark 的时候感触挺深,使用 NioSocketChannel 最高 qps 5600 ,替换成 EpollSocketChannel 之后 6300 qps,提升显著。但局限也是有的,1. 不兼容低版本 netty 2. 只在部分 linux 平台支持。 |
|
any further update on this pull request @zonghaishang |
|
Recently dealing with work, this feature will be completed by this week. |
|
Hi
Here are some benchmark between NioEventLoop and EpollEventLoop, may be helpful to us.
I will complete the full benchmark with multi concurrency this week.
## NioEventLoop
### loop 1
…--------------------------
Durations: 60.05s
Requests: 149128
Avg RT: 199.96ms
Max RT: 956.371ms
Min RT: 70.502ms
Error requests: 0
Valid requests: 149128
QPS: 2483.59
--------------------------
### loop 2
--------------------------
Durations: 60.10s
Requests: 167389
Avg RT: 178.01ms
Max RT: 869.573ms
Min RT: 56.505ms
Error requests: 0
Valid requests: 167389
QPS: 2785.27
--------------------------
### loop3
--------------------------
Durations: 60.08s
Requests: 182469
Avg RT: 163.76ms
Max RT: 1596.385ms
Min RT: 56.073ms
Error requests: 0
Valid requests: 182469
QPS: 3037.03
--------------------------
#### loop4
--------------------------
Durations: 60.09s
Requests: 195679
Avg RT: 152.67ms
Max RT: 585.317ms
Min RT: 59.803ms
Error requests: 0
Valid requests: 195679
QPS: 3056.37
--------------------------
## EpollEventLoop
### loop1
--------------------------
Durations: 60.07s
Requests: 186404
Avg RT: 161.60ms
Max RT: 769.791ms
Min RT: 62.629ms
Error requests: 0
Valid requests: 186404
QPS: 3102.88
--------------------------
### loop2
--------------------------
Durations: 60.04s
Requests: 188606
Avg RT: 158.21ms
Max RT: 402.622ms
Min RT: 56.726ms
Error requests: 0
Valid requests: 188606
QPS: 3141.41
--------------------------
### loop3
--------------------------
Durations: 60.10s
Requests: 189748
Avg RT: 157.53ms
Max RT: 399.215ms
Min RT: 59.836ms
Error requests: 0
Valid requests: 189748
QPS: 3157.08
--------------------------
### loop4
--------------------------
Durations: 60.06s
Requests: 191833
Avg RT: 156.00ms
Max RT: 1033.703ms
Min RT: 60.854ms
Error requests: 0
Valid requests: 191833
QPS: 3194.24
--------------------------
在 2018年12月10日,下午1:44,yì jí ***@***.***> 写道:
Recently dealing with work, this feature will be completed by this week.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub <#2738 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AK9DJkAOzrGZ1klc8_GMG5NqIAkLsCF_ks5u3fTSgaJpZM4YOPw8>.
|
|
@lexburner please provide test code, :-) |
|
any further update on this pull request @zonghaishang |
|
@beiwei30 I will modify it again as suggested by the code review. |
|
Hi
Here is my repository for dubbo epoll benchmark : https://github.com/lexburner/dubbo-epoll-benchmark <https://github.com/lexburner/dubbo-epoll-benchmark>
Pls add the consumer and provider using your feature/epoll dubbo branch to test it.
… 在 2018年12月11日,上午10:47,yì jí ***@***.***> 写道:
@beiwei30 <https://github.com/beiwei30> I will modify it again as suggested by the code review.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub <#2738 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AK9DJmHib_1RMbonnbtqzaC3lZ7PnsdHks5u3xykgaJpZM4YOPw8>.
|
What is the purpose of the change
support epoll for dubbo, refer: #2737
Brief changelog
Verifying this change
ci passed & benchmark test passed.
benchmark: https://github.com/zonghaishang/dubbo-benchmark/tree/epoll_benchmark
Follow this checklist to help us incorporate your contribution quickly and easily:
[Dubbo-XXX] Fix UnknownException when host config not exist #XXX. Each commit in the pull request should have a meaningful subject line and body.mvn clean install -DskipTests&mvn clean test-compile failsafe:integration-testto make sure unit-test and integration-test pass.