The meaning of `LeaderWeight` in pd ?

40 views
Skip to first unread message

王国真

unread,
Apr 8, 2018, 5:04:25 AM4/8/18
to TiDB user group


Is there any doc about `LeaderWeight` in [pd](https://github.com/pingcap/pd/blob/master/server/core/store.go#L40) ?

It's hard for me to understand `LeaderScore = LeaderSize / LeaderWeight`, and what value I should set according to my situation.

shenli

unread,
Apr 8, 2018, 9:48:38 AM4/8/18
to TiDB user group
Typically, the scheduler of a PD considers the ability of different store(i.e. tikv-server) to process and save data is equivalent, and it will try to make each store share a similar amount of data or requests.

However, in a specific scenario, the storage capacity and computing power of stores may be different. Therefore, we have introduced the _StoreWeight_ to handle this problem. It allows user to set different leader or region weights for each store, which are used to adjust a store's leader(the data used to handle requests) or region(the data occupies disk space) for a store.

The default value(the baseline) is 1, which means that if a store's _LeaderWeight_ is set to 0.8, the current store will be assigned approximately 80% of the leader relative to other stores. Similarly, if the _RegionWeight_ is set to 2, then the current store will be assigned twice as many regions relative to other stores.
Reply all
Reply to author
Forward
0 new messages