Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Guess in-flight chunk sizes in response transformer
It seems the simplistic approach becomes fairly slow when scaled down, and this once again amplifies the feedback, but with some limits in place. The main problem in estimating the impact of the additional requests is that we don't know how large the corresponding chunks will be. This uses a simple exponentially-weighted average over chunk sizes received in the past and assumes that the in-flight chunks are equally large. If the chunk sizes stay consistent, or don't change too dramatically in sizes, this should work well. In the event that the chunk sizes grow significantly we might still overshoot by a lot, so as an additional precaution we don't allow having more than 1000 chunks of unknown sizes in flight. If the chunk sizes changes rapidly and grow beyond 32k we could still be in trouble, but that seems very unlikely to happen, and we have to make some assumptions or else we can't request any data at all using the requests abstraction.
- Loading branch information