Java常用中间件之 NGINX实现限流功能的官方文档说明

    ...
    location /search/ {
        limit_req zone=one burst=5;
    }

Directives

Syntax:语法 limit_req zone=name [burst=number] [nodelay | delay=number];
Default: 默认
Context:内容(作用范围) httpserverlocation

Sets the shared memory zone and the maximum burst size of requests. If the requests rate exceeds the rate configured for a zone, their processing is delayed such that requests are processed at a defined rate. Excessive requests are delayed until their number exceeds the maximum burst size in which case the request is terminated with an error. By default, the maximum burst size is equal to zero. For example, the directives

设置共享内存区域和请求的最大突发大小。如果请求速率超过了区域配置的速率,则会延迟其处理,以便以定义的速率处理该请求。过多的请求将被延迟,直到其数量超过最大突发大小为止,在这种情况下,该请求将因错误而终止 。默认情况下,最大突发大小等于零。例如,指令

limit_req_zone $binary_remote_addr zone=one:10m rate=1r/s;

server {

location /search/ {
    limit_req zone=one burst=5;
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值