-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[3.7.X]Allow Exchange not to use SerialExecutor #2091
Comments
Do you have any benchmarks? What are the results, which speedup to you get? Without the serial executor, parallel processing applied to the same exchange causes failures, mainly for the observe/notify and blockwise parts. At that time, when the Anyway, if you don't care about potential failures and leaks (or handle them on your own), and if you have results, which justify such an change, I will think about the best way to do it. But first, please results. |
Oh, Yes, I was going to upgrade from 2.X to 3.X, but haven't done it yet due to compatibility issues. So I didn't do a performance test comparison. I use californium as a message forwarder (like nginx or Vert.x), so I expect to use californium to implement a high-performance COAP forwarder, like Vert.x (also using Netty). Vert.x only forwards messages and does not switch threads during encoding and decoding. When Netty is used, can the thread pool not be switched between the two places? californium/californium-core/src/main/java/org/eclipse/californium/core/network/CoapEndpoint.java Lines 1027 to 1046 in aec3f78
californium/californium-core/src/main/java/org/eclipse/californium/core/network/CoapEndpoint.java Lines 718 to 728 in aec3f78
This may be a big change, but is it possible to open the API to allow user to implement specific requirements by using californium.Stack californium.Matcher californium.layer to implement Endpoints themselves? |
For the UDP part the idea, to reduce the thread switching in order to gain performance was raised a couple of times in the past years. And always failed to verify the speedup. Therefore, please verify the speedup ahead.
Not sure, what you really want to do (and who should "fulfill" your expectation). Netty works that way, because the other functions are designed for that.
"Open the API" will not be the big thing, except you expect, that the other functions will then work with other threading models as well. That will be clearly someone else tasks to make it working. So again: After hat, clarify, which functions do you really want for the forwarding. e.g. If you replace the processing stack by a "reduced stack", then exchanging the execution may have a chance, as long as you spend your time in that "reduced stack" yourself. |
Any update?
|
Don't hesitate to add a comment or open a new issue, if you're interested again. |
See PR #2153 about null as Executor for Exchanges. |
Using the BenchmarkClient with 1000 concurrent clients with CON requests and still doesn't show any performance gain when disabling the There maybe other setups, which shows something, but for now 4 years no one demonstrated the performance benefit of switching the execution model. FMPOV, I will keep the "experimental" DUMMY_EXECUTOR but without spending time in developing that further. |
Okay, DUMMY_EXECUTOR is very good |
My Application Scenarios: high-performance CoAP over TCP Server
In large-capacity and high-performance application scenarios, We don't want to switch threads during message processing, because of the SerialExecutor of Exchange switching threads causes performance loss.
It is expected that threads will not be switched during CoAP decoding, message forwarding (such as using async http client), and CoAP encoding.
In version 2.X, we can set null to Exchange.executor to not switch threads. but this method is restricted in version 3.x
californium/californium-core/src/main/java/org/eclipse/californium/core/network/Exchange.java
Lines 364 to 372 in aec3f78
californium/californium-core/src/main/java/org/eclipse/californium/core/network/Exchange.java
Lines 623 to 625 in aec3f78
So, can we give the API more freedom? Like version 2.X , allow not to checkOwner . Do not force use SerialExecutor
californium/californium-core/src/main/java/org/eclipse/californium/core/network/Exchange.java
Lines 1145 to 1149 in 5220bb0
If can, I'd like to submit a PR
The text was updated successfully, but these errors were encountered: