Forum: NGINX global rate limit

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
D49f9b7b62d7d0b4e4acc996b615396c?d=identicon&s=25 Jakub Kasica (Guest)
on 2008-10-17 08:27
(Received via mailing list)
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.
Cab66b0caecae0068ab03d1f36b87273?d=identicon&s=25 Olivier Bonvalet (Guest)
on 2008-10-17 09:02
(Received via mailing list)
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
D49f9b7b62d7d0b4e4acc996b615396c?d=identicon&s=25 Jakub Kasica (Guest)
on 2008-10-17 09:28
(Received via mailing list)
2008/10/17 Olivier Bonvalet <nginx.list@daevel.fr>:

> 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.
5737fc4e5d49301cffce52ab6b2f0fc1?d=identicon&s=25 James Oakley (Guest)
on 2008-10-17 14:55
(Received via mailing list)
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:

http://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.
This topic is locked and can not be replied to.