# Global rate limit

**URL:** <https://www.ruby-forum.com/t/global-rate-limit/151134>\
**Category:** NGINX\
**Created:** [October 17, 2008, 8:27am UTC](https://www.ruby-forum.com/t/global-rate-limit/151134 "2008-10-17T08:27:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jakub\_Kasica](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@Jakub\_Kasica](https://www.ruby-forum.com/u/Jakub_Kasica)\
**Post date:** [October 17, 2008, 8:27am UTC](https://www.ruby-forum.com/t/global-rate-limit/151134/1 "2008-10-17T08:27:25Z")

</div>

Hello.  
Is there any possibility to limit traffic in nginx?  
I found limit rate directive but this limits only per client. I need  
something which can guarantee to keep me under 100 mbits because over  
this value i have to pay a bit to much.

---

<div class="post-metadata">

**Author:** ![Jakub\_Kasica](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@Jakub\_Kasica](https://www.ruby-forum.com/u/Jakub_Kasica)\
**Post date:** [October 17, 2008, 9:02am UTC](https://www.ruby-forum.com/t/global-rate-limit/151134/2 "2008-10-17T09:02:33Z")

</div>

Jakub Kasica a écrit :

> Hello.  
> Is there any possibility to limit traffic in nginx?  
> I found limit rate directive but this limits only per client. I need  
> something which can guarantee to keep me under 100 mbits because over  
> this value i have to pay a bit to much.

Hello,

you should maybe disable the “gigabit” on your network card, in Fast  
Ethernet you will never have this problem.  
At work we use “ethtool” (under Linux) to change speed of the network  
card.

If you use Linux you can limit the traffic with “iptables” too.

Olivier

---

<div class="post-metadata">

**Author:** ![Jakub\_Kasica](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@Jakub\_Kasica](https://www.ruby-forum.com/u/Jakub_Kasica)\
**Post date:** [October 17, 2008, 9:28am UTC](https://www.ruby-forum.com/t/global-rate-limit/151134/3 "2008-10-17T09:28:22Z")

</div>

2008/10/17 Olivier B.valet [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid):

> Hello,
> 
> you should maybe disable the “gigabit” on your network card, in Fast  
> Ethernet you will never have this problem.  
> At work we use “ethtool” (under Linux) to change speed of the network card.
> 
> If you use Linux you can limit the traffic with “iptables” too.  
> This is too global solution. I don’t want limit any other services.  
> I can use iptables and packet marking but i was wondering weather  
> there is any built-in solution in nginx.

---

<div class="post-metadata">

**Author:** ![Jakub\_Kasica](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/eb9ed0/32.png) [@Jakub\_Kasica](https://www.ruby-forum.com/u/Jakub_Kasica)\
**Post date:** [October 17, 2008, 2:55pm UTC](https://www.ruby-forum.com/t/global-rate-limit/151134/4 "2008-10-17T14:55:37Z")

</div>

On Thursday 16 October 2008 21:24:07 Jakub Kasica wrote:

> Hello.  
> Is there any possibility to limit traffic in nginx?  
> I found limit rate directive but this limits only per client. I need  
> something which can guarantee to keep me under 100 mbits because over  
> this value i have to pay a bit to much.

If you’re using Linux, you can use tc:

> **[Linux Advanced Routing & Traffic Control HOWTO](https://lartc.org/howto/)**

See the section “Queueing Disciplines for Bandwidth Management” for  
information about rate control. You will probably want to use  
Hierarchical  
Token Bucket (HTB).

See “Advanced filters for (re-)classifying packets” for information on  
how to  
control what traffic gets queued.

The cookbook section has some examples.
