labstack / echox

Echo cookbook and website
https://echo.labstack.com
MIT License
408 stars 285 forks source link

Feature/rate limiter docs #174

Closed iambenkay closed 3 years ago

iambenkay commented 3 years ago

Documentation for the rate limiter feature at echo@1724

iambenkay commented 3 years ago

@lammel notice this line

If your app receives above 100 parallel requests at once then this might not be the best option

Is it safe to say that this is false considering your breakthrough with the middleware handling about 30,000 requests per sec conveniently?

lammel commented 3 years ago

@lammel notice this line

If your app receives above 100 parallel requests at once then this might not be the best option

Is it safe to say that this is false considering your breakthrough with the middleware handling about 30,000 requests per sec conveniently?

Not necessarily. Handling 30000 req/s sequentially is different compared to handling 300req/s in parallel from 100 sources (which my test uses). This is where lock contention comes in. The number 100 is of course just a very vague estimate and shall only act as an indicator, that for high load traffic the builtin RateLimiterMemoryStore and ratelimiter might negatively influence performance of the app.

lammel commented 3 years ago

Thanks @iambenkay , adjusted some wordings and styling, think that's fine for now.