Skip to content

Throttler: throttler can treat different Apps differently. How does it work? #335

Answered by newborn22
newborn22 asked this question in Q&A
Discussion options

You must be logged in to vote

Program developers can call the func (throttler *Throttler) ThrottleApp(appName string, expireAt time.Time, ratio float64) (appThrottle *base.AppThrottle) function to let the throttler randomly throttle the appName according to the ratio before the expireAt time.

If the app’s name is in the form of "sub-appName1:sub-appName2:sub-appName3:....." like "75ba763c_6c98_11ee_913d_da3720e3a51e:vreplication:online-ddl", then any sub-appName being throttled will cause the app to be throttled.

In addition, setting the lowPriority in the flags parameter to true when calling func (throttler *Throttler) CheckByType(ctx context.Context, appName string, remoteAddr string, flags *CheckFlags, checkType Th…

Replies: 1 comment

Comment options

newborn22
Oct 20, 2023
Collaborator Author

You must be logged in to vote
0 replies
Answer selected by newborn22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant