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

[COST] Implement feedback for network ingress cost #1637

Merged

Conversation

harryteng9527
Copy link
Collaborator

@harryteng9527 harryteng9527 commented Apr 6, 2023

resolve #1629 (comment)

此 PR 為 NetworkIngressCost 實作 incompatibility,讓此 cost 能反饋不建議放在一起的 partitions,供未來 assignor 作為判斷依據

目前決定 incompatibility 的依據

利用 traffic intervalupper bound 判斷,依照同個節點的 partitions 來計算,若 partition 處於不同節點,則不管流量大小都適合放在一起

Traffic interval

為 NetworkIngressCost 可以設置的參數,此參數只會作用在輸入流量低於 upper bound 的 partitions,若輸入流量大於 upper bound 可以參考下方 upper bound 的介紹

輸入流量低於 upper bound 的 partition 計算 incompatibility 時,利用 traffic interval 設置的流量來判斷 partitions 適不適合與之放在一起,當 partition 彼此的流量差異超過 traffic interval 及不適合放在一起。反之,適合放在一起

Upper bound

為一個流量值,當 partition 的流量超過 upper bound,低於 upper bound 的 partitions 就不適合與之放在一起。 每個節點的 upper bound 可能不會相同

如何計算

  1. 計算同一節點的 partition 流量標準差計算
  2. 找出低於該標準差的 partitions 中,流量最高的 partition,依它的流量為 upper bound

計算 incompatibility 的範例

若節點 A 目前有 3 個 partitions:p-0, p-1, p-2,流量分別為 10MB, 30MB, 50MB, upper bound 為 16MB, traffic interval 為 10MB

p-0 的 incompatibility 為 {p-1, p-2}
p-1 的 incompatibility 為 {p-0}
p-2 的 incompatibility 為 {p-0}

p-0 的流入流量低於 upper bound (16 MB),所以不適合與 6 MB 以下、26 MB以上的 partition(s) 放在一起
p-1, p-2 的流入流量高於 upper bound,所以不適合與低於 upper bound 的 partition(s) 放在一起

@harryteng9527 harryteng9527 requested a review from chia7712 April 6, 2023 08:25
Copy link
Contributor

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@harryteng9527 感謝更新,還有幾個建議請看一下

Copy link
Contributor

@chia7712 chia7712 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@harryteng9527 harryteng9527 merged commit 27eff95 into opensource4you:main Apr 14, 2023
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.

[COST] NetworkIngressCost 需要實作反饋邏輯
2 participants