# Dynamically rate\_limit?

**URL:** <https://www.ruby-forum.com/t/dynamically-rate-limit/243206>\
**Category:** NGINX\
**Created:** [September 1, 2015, 2:55pm UTC](https://www.ruby-forum.com/t/dynamically-rate-limit/243206 "2015-09-01T14:55:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [September 1, 2015, 2:55pm UTC](https://www.ruby-forum.com/t/dynamically-rate-limit/243206/1 "2015-09-01T14:55:50Z")

</div>

Hi folks,

I’m after a way to dynamically adjust bandwidth in nginx.

Current vhost setup is:  
maximum connections 10  
max connection per client ip = 2  
maximum rate per connection = 8Mbit

Ideally, 5 clients x 2 connections x 8Mbit rate = 80 Mbit = 10 clients x  
1  
connection x 8Mbit rate

What I would prefer is to set the limit\_rate statement as a dynamical  
function of maximum shared bandwidth divided by the number of active  
connections  
therefore, first connection would get full 80Mbit, second connection  
40Mbit  
and so on

I did some search about this a year ago and couldn’t find anything  
matching  
this functionality

Has anything changed that would enable the above functionality ?

Thanks,  
Miro

Posted at Nginx Forum:

> **[dynamically rate\_limit ?](https://forum.nginx.org/read.php?2,261362,261362#msg-261362)**
>
> Hi folks, I'm after a way to dynamically adjust bandwidth in nginx. Current vhost setup is: maximum connections 10 max connection per client ip = 2 maximum rate per connection = 8Mbit Ideally, 5 clients x 2 connections x 8Mbit rate =
