[erlang-questions] Throttling HTTP requests

Dmitry Kolesnikov dmkolesnikov@REDACTED
Fri Sep 21 09:15:28 CEST 2018


Hi,

Global throttling might be challenging. You would need to run a proxy and define throttling policies there. I would discard this option unless you are talking about large service.

Let’s consider local throttling policies, where each api nodes maintain counters independently each other.
It was not clear do you want to reject request or put it into queue so that customers are still served but they latency grows.

There are few easy solutions, which does not require any Erlang
* Nginx
* Linux traffic shaping

If you keen to implement this feature in Erlang then please consider a circuit breaker pattern. You can create a fuse per IP address or sub network to reject a traffic.

Best Regards,
Dmitry


> On 21 Sep 2018, at 9.40, Frank Muller <frank.muller.erl@REDACTED> wrote:
> 
> Hi guys
> 
> We have an HTTP web service based Cowboy which is receiving more and more traffic.
> 
> We would like to implement a throttling mechanism per IP address to limit how many request/sec the same IP address can make.
> 
> Is there any library out there for that?
> Or any (simple yet efficient) algorithm to implement?
> 
> Ideas & feedabacks are very welcome.
> 
> Thanks in advance.
> 
> /Frank
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://erlang.org/mailman/listinfo/erlang-questions

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: Message signed with OpenPGP
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20180921/7301b92e/attachment.bin>


More information about the erlang-questions mailing list