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

需要一個機制來暴露 Balancer 內的運作情況 #1084

Closed
garyparrot opened this issue Nov 5, 2022 · 4 comments
Closed

需要一個機制來暴露 Balancer 內的運作情況 #1084

garyparrot opened this issue Nov 5, 2022 · 4 comments
Assignees

Comments

@garyparrot
Copy link
Collaborator

garyparrot commented Nov 5, 2022

未來會需要比較各種 Balancer 演算法的實作優異,或是對研發中的 Balancer 算法做微調,比較算法的效果有沒有更好。

為了做到這件事情,Balancer 必須要想辦法能將這些資訊暴露出去。我目前初步構想是輸出每時間點 cost 的降低的狀況。降低的速度多半可以反映出 Balancer 實作在面對一個問題時的找解能力有多好。

需求

  • Balancer 能夠釋出內部資訊(目前最大需求大概就 Cost
  • 有一個機制能夠串接 Balancer 釋出的內部資訊,用某種方式暴露出去 (e.g. JMX MBeans, File, Queue)

可能的變更方法

  1. 讓 Balancer 自己處理
    • 內部實作自己寫程式把這些資訊暴露出去
    • 缺點:每個 Balancer 要比較都需要暴露資訊,這樣邏輯會在各實作重複

上面的方法不太好,所以我們可能要推出其他介面來提供這個需求。

@garyparrot garyparrot self-assigned this Nov 5, 2022
@chia7712
Copy link
Contributor

chia7712 commented Nov 6, 2022

有一個機制能夠串接 Balancer 釋出的內部資訊,用某種方式暴露出去 (e.g. JMX MBeans, File, Queue)

這個概念不錯,可以先定義一下到底有哪些“通用的資訊”要收集,也就是每個Balancer都必須乖乖上繳該些數據,舉個例子:

  1. 每個plan (不管好壞) 的產生速度
  2. good plan 的產生速度
  3. bad plan 的產生速度
  4. cost 的下降速率

然後這些可以搭配我們設計的統計值來收集,並且提供一個APIs讓需要追蹤的人使用(或許放在Balancer上面)

@chia7712
Copy link
Contributor

chia7712 commented Nov 6, 2022

@chinghongfang 麻煩看一下上述的統計,看看是否已經可以使用

@garyparrot
Copy link
Collaborator Author

這個概念不錯,可以先定義一下到底有哪些“通用的資訊”要收集,也就是每個Balancer都必須乖乖上繳該些數據,舉個例子:

我覺得第一階段吐 cost 分數就好,可以先把相關的機制建立起來,然後再開始發展這些額外的數據。

晚點會發一個 Draft PR 討論看看

@garyparrot
Copy link
Collaborator Author

Completed by #1095.

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

No branches or pull requests

2 participants