<meta http-equiv="Content-Type" content="text/html; charset=GB18030"><div>Francis Daly£¬</div><div><br></div><div><span style="color: rgb(51, 51, 51); font-family: -apple-system, "PingFang SC", "Helvetica Neue", STHeiti, "Microsoft Yahei", Tahoma, sans-serif; font-size: 16px;">     </span><font color="#333333" face="-apple-system, PingFang SC, Helvetica Neue, STHeiti, Microsoft Yahei, Tahoma, sans-serif" style=""><span style="font-size: 16px;"> extremely appreciative of your feedback.</span></font></div><div><font color="#333333" face="-apple-system, PingFang SC, Helvetica Neue, STHeiti, Microsoft Yahei, Tahoma, sans-serif"><span style="font-size: 16px;"></span></font></div><div><br></div><div>     Any suggestion for third-party module that does some form of internal bandwidth limiting? </div><div><br></div><div><div>thanks</div><div>huiming</div><div><br></div><div><br></div><div style="font-size: 12px;font-family: Arial Narrow;padding:2px 0 2px 0;">------------------ Original ------------------</div><div style="font-size: 12px;background:#efefef;padding:8px;"><div><b>From:</b>                                                                                                                        "nginx"                                                                                    <francis@daoine.org>;</div><div><b>Date:</b> Thu, Dec 23, 2021 07:47 AM</div><div><b>To:</b> "nginx"<nginx@nginx.org>;<wbr></div><div></div><div><b>Subject:</b> Re: bandwidth limit for specific server</div></div><div><br></div>On Sat, Dec 18, 2021 at 01:37:11PM +0800, huiming wrote:<br><br>Hi there,<br><br>>   Is it possible to limit total bandwidth for server?<br><br>Using only stock nginx, I believe the answer is "yes, but not in a way<br>that you would want; so effectively no".<br><br>You can limit the number of concurrent (active) connections; you can<br>limit the rate of requests that nginx will process; and you can limit<br>the response bandwidth for each request.<br><br>By combining those, you can put an upper limit on the response bandwidth;<br>but I suspect that it is unlikely to be useful for you.<br><br><br><br>You might be happier looking for a third-party module that does some<br>form of internal bandwidth limiting; or use something outside of nginx<br>to limit the bandwidth.<br><br>The latter would probably be simpler if your chosen server_name was<br>the only one this nginx handled; or if the IP address were dedicated to<br>this server_name -- in those cases, the external thing would not need to<br>know much (or anything?) about what nginx is doing; it could just handle<br>"traffic from this process group", or "traffic from this IP address".<br><br>>   server {<br>>     listen   443 ssl;<br>>     server_name x.x.x.x.x;<br>> <br>> <br>>     is it possible to limit total bandwidth for this server to for example 5M ? not to limit TCP connection bandwidth. need total bandwidth.<br><br>It is using the TCP connection bandwidth limit; but if you were to<br>"limit_rate" to 1m and "limit_req" to 5 r/s, then you would not use<br>more than 5M (bps) -- but you would probably normally end up using less<br>than that; because individual requests would not use 5, while multiple<br>requests would probably lead to lots of small failure responses.<br><br>Good luck with it,<br><br>   f<br>-- <br>Francis Daly        francis@daoine.org<br>_______________________________________________<br>nginx mailing list<br>nginx@nginx.org<br>http://mailman.nginx.org/mailman/listinfo/nginx</div>