Skip to content
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

SWRR supports the calculation of multiple topics #353

Merged
merged 3 commits into from
May 26, 2022

Conversation

wycccccc
Copy link
Collaborator

如題,完成 #315 後續討論部分,這裏只是完成該功能,並不是模擬程式。

@wycccccc
Copy link
Collaborator Author

wycccccc commented May 20, 2022

我模擬了一下,大致情況我用蒼白的文字描述一下。
情景:
250節點
topicA分佈在0~149節點
topicB分佈在100~249節點
節點權重都爲1
向每個topic發送8000筆資料
發送資料的順序如下:
發1筆去A
發1筆去B
發1筆去A
上述操作重複4000次。

發1筆去B
上述操作重複4000次。

不根據topic進行權重操作
平均每臺受到收到的資料
topicA:0~99:54筆
100~149:52筆
150~249:0筆
topicB:0~99:0筆
100~149:19筆
150~249:71筆

加總
0~99:54筆
100~149:71筆
150~249:71筆

根據topic進行權重操作
它的分佈有點複雜只能上圖了
平均每臺受到收到的資料
TopicA
image
TopicB
image
可以看到圖中有一些空隙在100~149中,這是由於上述每個topic固定發送順序造成的,爲了讓每個節點接收到的總資料平均,
結果每個topic發給每個node的資料就不平均了。這在發送順序固定的時候可能會造成惡劣影響。
我截取一小段數據可能會清晰一些 topicA如下:111,80.0
112,27.0
113,80.0
114,80.0
115,27.0
116,80.0
117,80.0
118,0.0
119,80.0
120,80.0
121,0.0
122,80.0
123,80.0
這可能會是一個需要討論的問題,如果對多topic的發送順序一直保持固定會帶來的影響。

加總
0~99:54筆
100~149:107筆
150~249:54筆

可以看到中間那段重疊了兩個topic所以收到了兩倍的資料量。我有更改了一下資料的發送方式繼續做實驗。改成打一筆A打一筆B這種循環的方式,資料在topic內的分佈就平均了。現在看來着一塊可能還有新故事。

不過在總資料的分配上和預期的沒有差別,模擬也算是論證了想法(八成)。

@wycccccc
Copy link
Collaborator Author

在模擬的過程中還有發現一些效能問題,我明天會再思考修改一下。

@wycccccc
Copy link
Collaborator Author

這個pr大概就先這樣了,我簡單的處理了下topic更新節點資訊的問題。之後我會發pr再配合clusterInfo的更新頻率做topic分佈節點的更新。

@chia7712 chia7712 merged commit 6a6135c into opensource4you:main May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants