# Bandwidth throttling (on a per ip/user basis)

**URL:** <https://www.ruby-forum.com/t/bandwidth-throttling-on-a-per-ip-user-basis/146140>\
**Category:** NGINX\
**Created:** [August 18, 2008, 1:22pm UTC](https://www.ruby-forum.com/t/bandwidth-throttling-on-a-per-ip-user-basis/146140 "2008-08-18T13:22:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Armin\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@Armin\_R](https://www.ruby-forum.com/u/Armin_R)\
**Post date:** [August 18, 2008, 1:22pm UTC](https://www.ruby-forum.com/t/bandwidth-throttling-on-a-per-ip-user-basis/146140/1 "2008-08-18T13:22:21Z")

</div>

Dear all,

does anybody have any experience throttling  
the bandwith on a per ip/user basis with nginx?

Any pointers, ideas, etc. how to implement this  
would be highly appreciated.

All the best,  
-Armin

---

<div class="post-metadata">

**Author:** ![Armin\_R](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7feea3/32.png) [@Armin\_R](https://www.ruby-forum.com/u/Armin_R)\
**Post date:** [August 18, 2008, 2:36pm UTC](https://www.ruby-forum.com/t/bandwidth-throttling-on-a-per-ip-user-basis/146140/2 "2008-08-18T14:36:47Z")

</div>

Hello!

On Mon, Aug 18, 2008 at 01:12:23PM +0200, Armin R. wrote:

> does anybody have any experience throttling  
> the bandwith on a per ip/user basis with nginx?
> 
> Any pointers, ideas, etc. how to implement this  
> would be highly appreciated.

The only way to do it with nginx is to use request bandwidth  
limits with connection number limits. See:

[http://wiki.codemongers.com/NginxHttpCoreModule#limit\_rate](http://wiki.codemongers.com/NginxHttpCoreModule#limit_rate)  
[http://wiki.codemongers.com/NginxHttpLimitZoneModule](http://wiki.codemongers.com/NginxHttpLimitZoneModule)

This can’t effectively limit bandwidth for many small requests and  
doesn’t allow flexible aggregate limits though. So it’s probably  
better to use your firewall for bandwidth limiting instead.

Maxim D.
