我试图达到这种情况:
仅在特定的path上,我在前端收到稳定的9个请求/秒。 一切都很好,使用常规的后端。 我现在收到11请求/秒,我想拒绝任何超过10的请求。但仍然想继续回复最多10请求/秒。
我发现并试图实现的一切(如: https : //blog.codecentric.de/en/2014/12/haproxy-http-header-rate-limiting/ )是黑色或白色的解决scheme,费率达到。 所以这是对DDOS,滥用者的保护,但不是一个真正的限速解决scheme。
有什么办法可以实现吗?
PS:使用HAproxy 1.5.8
如果你想使用rate-limit sessions ,以下是否可行?
frontend http_in bind 0.0.0.0:80 acl is_path url_beg /path/example/ use_backend forwarder if is_path backend forwarder server localhost 127.0.0.1:4444 send-proxy frontend limit_path_backend bind 127.0.0.1:4444 accept-proxy rate-limit sessions 10 default_backend webnodes