<div dir="ltr"><div>I was trying to use <a href="https://github.com/uwiger/jobs" target="_blank">https://github.com/uwiger/jobs</a> for rate limiting in my recent project.</div><div>With the spike pattern, this library was not performing. I had to accept 50k requests in ~10-20s, queue them and then handle them at a limited rate (10tps).</div><div>The rate was limited way more, than configured (1tps instead of 10tps, etc).</div><div>Then I switched to a custom gen_server with timer:sleep/1 and queue in the process inbox.<br></div><div><br></div><div>Karolis<br></div></div><br><div class="gmail_quote"><div dir="ltr">On Fri, Sep 21, 2018 at 10:19 AM Roger Lipscombe <<a href="mailto:roger@differentpla.net">roger@differentpla.net</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div dir="ltr"><div dir="ltr">I've not tried, but it looks like you could use <a href="https://github.com/uwiger/jobs" target="_blank">https://github.com/uwiger/jobs</a> and write some cowboy middleware that returns 429.</div><div dir="ltr"><br></div><div>Or do what we do: since our HTTP-stuff is fronted by nginx (for SSL termination and upstream service routing), we used <a href="https://www.nginx.com/blog/rate-limiting-nginx/" target="_blank">https://www.nginx.com/blog/rate-limiting-nginx/</a></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 21 September 2018 at 07:40, Frank Muller <span dir="ltr"><<a href="mailto:frank.muller.erl@gmail.com" target="_blank">frank.muller.erl@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto">Hi guys</div><div dir="auto"><br></div><div dir="auto">We have an HTTP web service based Cowboy which is receiving more and more traffic.</div><div dir="auto"><br></div><div dir="auto">We would like to implement a throttling mechanism per IP address to limit how many request/sec the same IP address can make.</div><div dir="auto"><br></div><div dir="auto">Is there any library out there for that?</div><div dir="auto">Or any (simple yet efficient) algorithm to implement?</div><div dir="auto"><br></div><div dir="auto">Ideas & feedabacks are very welcome. </div><div dir="auto"><br></div><div dir="auto">Thanks in advance.</div><span class="m_-3747105695059616470HOEnZb"><font color="#888888"><div dir="auto"><br></div><div dir="auto">/Frank</div>
</font></span><br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br></div>
_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org" target="_blank">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" rel="noreferrer" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
</blockquote></div>