Score:0

Differentiate and limit nginx bandwith for download connections, website content

br flag

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?

djdomi avatar
za flag
Does this answer your question? [throttle nginx bandwidth per website](https://serverfault.com/questions/558148/throttle-nginx-bandwidth-per-website)
djdomi avatar
za flag
However, the doc what you are telling is the correct way to solve this, so what's the issue?
loopend avatar
br flag
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.
djdomi avatar
za flag
I would suggest to use a subdir to identify download
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.