Limit/Ballance download speed in Mbit/s

As I’m a bit lost where to ask this - is there any way to limit the download speed with nginx (or easyengine v3) to say 50Mbit/s per User (not per connection)?

I have a wordpress site and some many big downloads (like 5-15GB). If many people start downloading I noticed that some can download very fast (like 100mbit/s) while then others are just creeping along at 1-2mbit/s. All rate limits with nginx that I’ve found limit connections per IP to the server or similar - but I don’t know how I can limit the actual download speed for the user (or the upload speed from the server per IP). The server has 1000Mbit/s dedicated connection (and faster would not help with the downloads are served from HDD not NVME and with concurrent access maybe even the HDD is the bottleneck).

ups found out - I misunderstood the limit_rate nginx directive.
limit_conn addr 5;
limit_rate_after 1m;
limit_rate 2000k;

or similar would do. However too bad there is no limit_rate per IP. I would like to limit the speed to 100Mbit/s per IP - not to 1/5 of it which restricts people who have a browser opening up only 1 connection the stuck at 20Mbit/s.

Nginx can do conditionals if statements, you should read up on their docs or Google around.

server {
    if ($remote_addr = 1.2.3.4) {
        limit_conn addr 5;
		limit_rate_after 1m;
		limit_rate 2000k;
    }
   ...
}

Yes I know the if statement - but I don’t want to limit a specific IP address. How can I have a

server {
if (open_conn addr 5; limit_rate XXX;)
if (open_conn addr 4; limit_rate YYY;)

I don’t see any way to find out the open connections. I can only limit or am I overlooking something?

In general an intelligent limit_rate would be great - but nginx only kinda does this for open connections (bucket thingy) but not for download rates. E.g. a way to tell nginx overal limit is 125MB/s, monitor how much of it is used and then decrease the max speed for users that download very fast. Right now it’s a bit of a hit or miss so sometimes one user could download at 90MB/s and leaving only 35MB/s to all other users…

Using a limit_rate depending on open connections would already help (so I could say no single user of the {server block may download faster than 150Mbit/s - which is sufficiently fast for a single user - while leaving enough bandwith for the rest (and not a single user with 1000Mbit connection being able to use up the full server bandwith).