All Projects → sportebois → nginx-rate-limit-sandbox

sportebois / nginx-rate-limit-sandbox

Licence: other
Docker image with various NGINX rate limit settings to play with burst and nodelay settings

Programming Languages

HTML
75241 projects

Projects that are alternatives of or similar to nginx-rate-limit-sandbox

Movie Recommender System
Basic Movie Recommendation Web Application using user-item collaborative filtering.
Stars: ✭ 85 (+2.41%)
Mutual labels:  rate
Limitrr
Light NodeJS rate limiting and response delaying using Redis - including Express middleware.
Stars: ✭ 203 (+144.58%)
Mutual labels:  rate
Material-Smart-Rating
😍⭐⭐Material Smart Rating App - An Android library that encourages users to rate the app on Google Play.⭐⭐😘
Stars: ✭ 30 (-63.86%)
Mutual labels:  rate
Moeda
💰 📈 A foreign exchange rates and currency conversion using CLI
Stars: ✭ 113 (+36.14%)
Mutual labels:  rate
Ngx Bar Rating
Angular Bar Rating
Stars: ✭ 146 (+75.9%)
Mutual labels:  rate
flood-protection
Flood protection for realtime applications
Stars: ✭ 19 (-77.11%)
Mutual labels:  rate
Redisratelimiter
Redis Based API Access Rate Limiter
Stars: ✭ 80 (-3.61%)
Mutual labels:  rate
UniRate
Unity plugin to easily manage the application frame rate and rendering interval. Preventing battery power consumption and device heat, especially on mobile platforms.
Stars: ✭ 26 (-68.67%)
Mutual labels:  rate
Zztools
包括: StarView星星评价(支持半星, 整星, 任意星, 支持拖动, 支持自定义星星图片, 数量, 大小, 间距, 最低分值). 瀑布流(垂直, 浮动, 混合模式瀑布流)等.
Stars: ✭ 175 (+110.84%)
Mutual labels:  rate
crypto-monitor
Monitor the crypto currency rate
Stars: ✭ 71 (-14.46%)
Mutual labels:  rate
Androidrate
AndroidRate is a library to help you promote your Android app by prompting users to rate the app after using it for a few days.
Stars: ✭ 117 (+40.96%)
Mutual labels:  rate
Node Rate Limiter Flexible
Node.js rate limit requests by key with atomic increments in single process or distributed environment.
Stars: ✭ 1,950 (+2249.4%)
Mutual labels:  rate
rate-limiter
The Rate Limiter Component provides a Token Bucket implementation to rate limit input and output in your application.
Stars: ✭ 156 (+87.95%)
Mutual labels:  rate
Laravel Likeable
Rate Eloquent models with Likes and Dislikes in Laravel. Development moved to Laravel Love package!
Stars: ✭ 95 (+14.46%)
Mutual labels:  rate
adaptive throttler
manages multiple throttlers with ability to ramp up and down
Stars: ✭ 31 (-62.65%)
Mutual labels:  rate
Starrate
swift电商五星评价,星星评分控件,支持自定义数量、拖拽、间隔、设置最小星星数等操作
Stars: ✭ 85 (+2.41%)
Mutual labels:  rate
vue-cute-rate
Simple to use and very cute rate component for Vue.js.
Stars: ✭ 43 (-48.19%)
Mutual labels:  rate
limio
A rate limiting library for Go centered around intuitive and idiomatic interfaces, and designed to limit silly window syndrome.
Stars: ✭ 51 (-38.55%)
Mutual labels:  rate
rating
⭐ A true Bayesian rating system with scope and cache enabled
Stars: ✭ 49 (-40.96%)
Mutual labels:  rate
arbolito
A currency conversion api for the minimalist developer
Stars: ✭ 50 (-39.76%)
Mutual labels:  rate

NGINX Rate Limit, Burst and nodelay sandbox

NGINX Rate limiting is more traffic-shaping than pure rate-limiting. And this is an important point to understand how it works with the burst and no_delay settings.

Tools: Docker, and Siege (you can brew-it, or use other cli load-testing tools like ab or artillery or anything you like!)

The Nginx config defines a few locations to test the various combinations of:

  • limit_req_zone by uri or by ip
  • using the burst argument (set to 5 in this case) or not
  • adding nodelay to control how to deal with request going over-quota during bursts.

The rates defined are:

  • 30 req/min
  • burst locations allow a burst of 5

With the leaky bucket, that means a new request should be allowed ever 2 seconds.

The endpoints defined are:

Test it!

Run the Nginx in a docker container:

Choose one of:

# If you want to see NGINX logs
docker run -it --rm -p 80:80 sportebois/nginx-rate-limit-sandbox
# If you want to run it in the background
NGINX_CONTAINER_ID=$(docker run -d --rm -p 80:80 sportebois/nginx-rate-limit-sandbox)
# Then when you want to stop and clean it:
docker stop $NGINX_CONTAINER_ID

Using Siege to send 10 concurrent requests at once on the various endpoints The most interesting ones are the burst5 and burst5_nodelay which let you really visualize and remember how nginx deal with burst settings!

siege -b -r 1 -c 10 http://127.0.0.1:80/by-uri/burst0
siege -b -r 1 -c 10 http://127.0.0.1:80/by-uri/burst0_nodelay
siege -b -r 1 -c 10 http://127.0.0.1:80/by-uri/burst5
siege -b -r 1 -c 10 http://127.0.0.1:80/by-uri/burst5_nodelay

siege -b -r 1 -c 10 http://127.0.0.1:80/by-ip/burst0
siege -b -r 1 -c 10 http://127.0.0.1:80/by-ip/burst0_nodelay
siege -b -r 1 -c 10 http://127.0.0.1:80/by-ip/burst5
siege -b -r 1 -c 10 http://127.0.0.1:80/by-ip/burst5_nodelay

When doing these tests, you will want to pay attention to:

  • the success/status code (obviously)
  • the response time it took, both for the rate-limited requests and the succesfull requests

You should see something like this, then you'll be able to play with all the other various locations/settings: burst5_output

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].