deny limit exceeding connections
kraiz opened this issue · comments
I need to deny new connections if they would exceed the limit. I can't risk to slow down current connections.
Is there a way to access the last_rate variable or do you have another suggestion for me?
There is no last_rate var in nginx.
Average rate could be gotten from (r->connection->sent / sec), but it's
different with last rate.
To calculate last rate, the time windown must be defined firstly. It
means that you want the rate
in last 1 minute or 10 seconds.
For example, If you want the last rate in 10 seconds, the limit module
could save the connection sent bytes
in every seconds looply into a 10 elements array for last 10 seconds. Then
last_rate = (r->connection->sent - sent_bytes[10] ) / 10
于 2013-2-7 15:45, Lars Kreisz 写道:
I need to deny new connections if they would exceed the limit. I can't
risk to slow down current connections.Is there a way to access the last_rate variable or do you have another
suggestion for me?—
Reply to this email directly or view it on GitHub
#3.
Ok, i thought you could expose some of your variables into the configuration. Thx for your suggestion, but i'm not really willing to delelop my own nginx plugin. Thx anyway :)