Bidder throttling
@hhhjort to provide details on algorithm here
Implemented in #4415
Discussed in backlog. Let's add details on the algorithm on this ticket and then add another row in the PBS features table in the docs (https://docs.prebid.org/prebid-server/features/pbs-feature-idx.html) just after circuit breaking as this is the Go circuit breaking option.
I think the algorithm could be improved by using sliding window approach instead of constant speed https://github.com/prebid/prebid-server/blob/fc184a88aaa498b3e42ecdd124632771fe824d10/config/config.go#L987C37-L987C52
The problems with this constant are:
- Multiple deployments where one cluster receives 100K QPS, while another receives only 1K - you need to maintain 2 different constants and know which QPS expects the cluster.
- Some customers can double their traffic without prior notice, traffic typically increases during the day and drops at night, with bursts on holidays.
- Adjusting the constant requires redeploying everything
With a sliding window, PBS can measure the rate of successful and failed requests within a time window, and begin dropping requests or apply a circuit breaker method if the success rate falls below a defined threshold