alibaba / alibaba/Sentinel

About the cluster flow control implementation in large traffic scenarios

Open
#539 0 comments 2 reactions 0 assignees View on GitHub
area/cluster-flow kind/discussion kind/feature
Dominant language
Java
Stars
23.1k
Forks
8.1k
PR merge metrics
No merged PRs in 30d

Description

## Clustering Model

Currently sentinel peers in clustering are divided into to role:

Client and Server

All clients will be booted with server address specified using parameters and then they will get permits from server every request arrived. (We have not applied clustering but i read the codes. Am i wrong?)

Sharing with no ha
HA Arch

So there maybe the bottleneck when clients or traffic growing. And official solution currently is dividing them into several groups like:

grouping

So it is more complex and introducing more operations.

Is it possible to increase the capacity before we must divide them into several groups?

## Discussion

The purpose is to reduce hits between clients and server, thus typically make it not a linear growth with requests per time unit on every client, and so is band cost and keep the flow chart shape of the whole cluster as expected:

Flow shaping

Someone may heard of PID controller in motor driving. We often use PID to keep motor's position or rotating speed or other metrics. The basic principle is to separate timeline into small pieces and make a decision on whether should change parameters at every time piece's end according to the executing results in previous piece detected through sensors or signals. And we convert a `realtime `controlling problem into a `step by step` controlling problem.

So is it possible clients can get the permits and report the flow data `batched` in fixed interval(thus, periodically)?

Then it will not be connected to the load of clients accepted. It's based on the flow will not change rapidly between clients.

Periodically

## Points

* Clients can get several pieces permits one time. (eg. 5 seconds)
* Clients will report every pieces's metric data to server.
* Server will evaluate permits usage of each clients and adjust every clients' next permits. (next 5 seconds' permits they can get) So actually limits will be adjusted once a second.

And we can use less server or typically two severs in HA to handle most cases maybe.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.