-
Notifications
You must be signed in to change notification settings - Fork 11.9k
[ISSUE #4098]Optimized the algorithm of trace message send. #4099
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
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #4099 +/- ##
=============================================
+ Coverage 47.46% 47.88% +0.41%
- Complexity 4909 5000 +91
=============================================
Files 633 634 +1
Lines 42317 42533 +216
Branches 5544 5574 +30
=============================================
+ Hits 20086 20367 +281
+ Misses 19744 19666 -78
- Partials 2487 2500 +13
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
@dugenkui03 I found another issue. So the algorithm may need to consider the byte size too. If the byte size is enough, it should be scheduled immediately. BTW, the data topic generated by "sendTraceData" is not used in "sendTraceDataByMQ". Maybe we need to clarify the design of topic mechanism for trace. |
@dongeforever Thanks for you suggestion. I trace the code and find we need do more to speed up performance( such as reduce the total number of send trace message). And the only benefit of this pr is that make the timing of submiting AsyncAppenderRequest more clearly, and it's is hard to say it's really improve the perfromance. Describe in Chinese感谢建议和提醒,按照你的提示我跟踪代码后发现提交的任务 当前的任务 该pr可以使任务 当前逻辑
当前逻辑的问题是 优化思路
该算法的总体思路是在数据达到大小阈值 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think there's no need to be so precise. The logic is a little complicated.
最新的代码已经在 pr-4180 中进行review,其实我认为这个优化是十分有意义的。我们可以简单做下分析: 100个会发送给不同traceTopic的轨迹消息生产者均以 1个/ms 的速度提交轨迹消息,那么原始的算法每次循环结束都会进行100次网络IO发送消息、因为消息要发送给100个不同的traceTopic。100ms中100次循环就会产生1w次网络IO。但最优思路应该是对这100ms中产生的消息按照要发送的traceTopic进行分组然后发送,最优次数应该是100次、而非1w次。 而优化的算法则是持续不断的将这些不同目标traceTopic的数据分配到traceTopic对应的缓存对象 |
…yncTraceDispatcher` (#4180) * Optimized the performance of sending traceMessage * Optimized the performance of sending traceMessage * Optimized the performance of sending traceMessage * Optimized the performance of sending traceMessage
@dugenkui03 Since another related PR #4180 is merged. Thanks for your contribution. |
…in `AsyncTraceDispatcher` (apache#4180) * Optimized the performance of sending traceMessage * Optimized the performance of sending traceMessage * Optimized the performance of sending traceMessage * Optimized the performance of sending traceMessage
Make sure set the target branch to
develop
What is the purpose of the change
XXXXX
Brief changelog
#4098
Verifying this change
XXXX
Follow this checklist to help us incorporate your contribution quickly and easily. Notice,
it would be helpful if you could finish the following 5 checklist(the last one is not necessary)before request the community to review your PR
.[ISSUE #123] Fix UnknownException when host config not exist
. Each commit in the pull request should have a meaningful subject line and body.mvn -B clean apache-rat:check findbugs:findbugs checkstyle:checkstyle
to make sure basic checks pass. Runmvn clean install -DskipITs
to make sure unit-test pass. Runmvn clean test-compile failsafe:integration-test
to make sure integration-test pass.