0

Is it possible (without additional tools or the addition of another distribution system) to limit the bandwith of overall download connections (upload to peers that requested to download a file) so that they do not congest the interface and thus slowing down website responsiveness, e.g. allow a maximum of 800 Mbps for downloads, so that at every time there are left theoretically 200 Mbps for general (website) content serving?

The only thing that came up to me when browsing nginx docs was https://docs.nginx.com/nginx/admin-guide/security-controls/controlling-access-proxied-http/ but this is only for (a) single peer connections, not a total rate limit and (b) connections in general, not differentiating between serving type.

I imagine one would have to implement a specific connection type for files to be served as downloads to the visitor, like using a separate server block definition for this. This way downloads could be regulated with a rate limit while not affecting the "normal" content serving, but this is still limited to the method above that only sets limit per IP.

Any hints how this is generally solved without just throwing CDN services at me?

loopend
  • 11
  • 3
  • Does this answer your question? [throttle nginx bandwidth per website](https://serverfault.com/questions/558148/throttle-nginx-bandwidth-per-website) – djdomi Jun 27 '21 at 19:37
  • However, the doc what you are telling is the correct way to solve this, so what's the issue? – djdomi Jun 27 '21 at 19:38
  • As stated I'm wondering what would be the simplest way to differentiate between (a) website downloads and (b) normal content traffic (web pages itself) even though they are on the same connection port (443) and for the same IP per user. Without this differentiation the rate_limit does not help to prevent interface congestion with a lot of concurrent, big downloads that would slow down website responsiveness. – loopend Jun 30 '21 at 15:46
  • I would suggest to use a subdir to identify download – djdomi Jun 30 '21 at 17:22

0 Answers0