July 2017
Beginner to intermediate
340 pages
7h 43m
English
Rate limiting consists of counting how many requests a server is accepting in a period of time, and rejecting new ones when a limit is reached.
Concurrency limiting consists of counting how many concurrent requests are being served by the web server to the same remote user and starting to reject new ones when it reaches a defined threshold. Since many requests can reach the server simultaneously, a concurrency limiter needs to have a small allowance in its threshold.
Both are implemented using the same technique. Let's look at how to build a concurrency limiter.
OpenResty ships with a rate limiting library written in Lua called lua-resty-limit-traffic (https://github.com/openresty/lua-resty-limit-traffic); you ...
Read now
Unlock full access