Project-Faster / qpep

A working version of qpep standalone go client/server, designed to accelerate high-latency connections, like those provided by geostationary satellites.
https://docs.projectfaster.org
Other
3 stars 1 forks source link

Client speed throttling #26

Closed parvit closed 1 year ago

parvit commented 1 year ago

Feature to limit the speed at which the server transfers data to and from the client.

A global maximum speed limit would be set either in the configuration or changed at runtime via a possible Admin interface.

Another possibility for control would be to limit the total number of connections currently open by the client and refuse new ones until others are closed.

parvit commented 1 year ago

@mfoxworthy @bizzbyster The current change is configured via the main config file, on the server side. A speed limit can be set on either the client itself (incoming connection) or the server tcp request (outgoing connection).

The addresses can be either be specifed via a domain name, an ip address or a cidr (eg. 127.0.0.1/24) subnet.

An example definition (in addition to the current config):

limits:
  clients:
    172.88.50.1/25: 100K

  destinations:
    wikipedia.com: 0
    172.88.50.1/25: 200K

This would limit incoming connections (client) for the ip range 172.88.50.1 - 172.88.50.126 to 100Kb/s to the server, by the same token connections to the same range in the outgoing direction (destinations) would be limited to 200Kb/s. In addition no connections to the resolved address of the wikipedia.com domain would be allowed.

Currently this is an opt-in mechanism and connections that do not fall in the limits definitions are handled by the server to its max capacity. If there is interest for setting a global limit let me know and we can integrate it in a similar fashion.