Global rate limit

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.

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

2008/10/17 Olivier B.valet [email protected]:

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.

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.