I would like to use nginx's ngx_http_limit_req_module to control the amount of transfer.
https://gist.github.com/miurahr/fe953d47f4148e15e517
http{
limit_req_zone$binary_remote_addr zone=tile_req:20m rate=16r/s;
...
server{
...
location / {
limit_req zone = tile_req burst = 45;
}
The token bucket algorithm allows flow control in this way, and nodelay
makes it work like a leaky bucket algorithm.
Now, is it possible to control both sides in a way that is good?
What we want to do is access from the same IP address.
1. I want to control the flow rate according to the average transfer amount that burst is allowed.
2. I would like to return a dedicated error page with an http429 response code to clients that continue to use the upper limit for a long time (for example, 10 minutes).
It's about satisfying both at the same time.(1)Single can be achieved with the above configuration. (2) Single can be achieved with nodelay
per minute and per hour.
Both can be accomplished in a single way, but is it possible to achieve both simultaneously?
How about doing this?
http{
limit_req_zone$binary_remote_addr zone=throttle:20m rate=16r/s;
limit_req_zone$binary_remote_addr zone=abuse —20m rate=960r/m;
...
server{
...
location / {
limit_req zone = throttle burst = 45;
limit_req zone =abuse modelay;
}
I feel that it will be difficult as requested.
Wouldn't this be an alternative?
573 rails db:create error: Could not find mysql2-0.5.4 in any of the sources
618 Uncaught (inpromise) Error on Electron: An object could not be cloned
916 When building Fast API+Uvicorn environment with PyInstaller, console=False results in an error
574 Who developed the "avformat-59.dll" that comes with FFmpeg?
© 2024 OneMinuteCode. All rights reserved.