Welcome! Log In Create A New Profile

Advanced

Re: limit_rate for POST targets ?

jb
April 13, 2015 09:04PM
It is true that the best way to rate limit is the sender. But in the event
where the sender is a myriad different browsers, that isn't an option.
There is no control at the POST level to throttle an upload. There isn't
really any good firewall tool for traffic shaping incoming data per tcp
stream either. You can traffic shape to a port, but not as easily per
stream.

For a particular application I'd like to simulate the effect of uploading
at a specific rate. Since I got the desired effect by crudely limiting the
rate at which nginx reads its input socket (with usleep) it seemed possible
that a mirror of the limit_rate code for sending could be applied to
reading as well.

It wouldn't be ideal, but if the server was dedicated to this and not other
things, I'm not sure it would have any disastrous effects?

thanks
-Justin


On Tue, Apr 14, 2015 at 3:03 AM, B.R. <reallfqq-nginx@yahoo.fr> wrote:

> I do not get (aha) where you saw limit_rate only applies to the GET
> method...
> But yeah limit_rate applies to resposnes.
>
> Rate limiting only properly applies to sender, in your case the client,
> which is the sole entity ablte to properly craft its requests to contain a
> specified amount of data/time period.
> ​The only thi​ng you can limit on intermediaries/receiver is
> connections/packets, because it is network-related structures which are
> trivial to handle/buffer.
>
> Rate-limiting on a transmitting/receiving end requires buffering content
> (not envelope, so that means application logic/DPI), and re-crafting
> forwarded/processed content into suitable network envelopes.
> Way too expensive/dangerous/demanding.
>
> You can limit incoming transmissions in nginx based on connections
> (limit_conn) or requests (limit_req).
> You can limit incoming transmissions at TCP level in firewalls surch as
> iptables based on connections and/or packets.
>
> ​My 2 cents,​
> ---
> *B. R.*
>
> On Sat, Apr 11, 2015 at 2:25 PM, Justin <justinbeech@gmail.com> wrote:
>
>> hmm that is rate limiting req/s
>>
>> i am looking for an exact limit_rate equivalent - which is bytes/second..
>>
>> > On 11 Apr 2015, at 10:13 pm, itpp2012 <nginx-forum@nginx.us> wrote:
>> >
>> > Lua would be a way to go,
>> > ea. https://github.com/fanhattan/lua-resty-rate-limit
>> >
>> > Posted at Nginx Forum:
>> http://forum.nginx.org/read.php?2,257905,257965#msg-257965
>> >
>> > _______________________________________________
>> > nginx mailing list
>> > nginx@nginx.org
>> > http://mailman.nginx.org/mailman/listinfo/nginx
>>
>> _______________________________________________
>> nginx mailing list
>> nginx@nginx.org
>> http://mailman.nginx.org/mailman/listinfo/nginx
>>
>
>
> _______________________________________________
> nginx mailing list
> nginx@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx
>
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

limit_rate for POST targets ?

jb April 08, 2015 02:26AM

Re: limit_rate for POST targets ?

jb April 10, 2015 05:24PM

Re: limit_rate for POST targets ?

B.R. April 11, 2015 07:26AM

Re: limit_rate for POST targets ?

Justin April 11, 2015 07:52AM

Re: limit_rate for POST targets ?

itpp2012 April 11, 2015 08:13AM

Re: limit_rate for POST targets ?

Justin April 11, 2015 08:26AM

Re: limit_rate for POST targets ?

B.R. April 13, 2015 01:06PM

Re: limit_rate for POST targets ?

jb April 13, 2015 09:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 189
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready