久久久久久久视色,久久电影免费精品,中文亚洲欧美乱码在线观看,在线免费播放AV片

<center id="vfaef"><input id="vfaef"><table id="vfaef"></table></input></center>

    <p id="vfaef"><kbd id="vfaef"></kbd></p>

    
    
    <pre id="vfaef"><u id="vfaef"></u></pre>

      <thead id="vfaef"><input id="vfaef"></input></thead>

    1. 站長資訊網(wǎng)
      最全最豐富的資訊網(wǎng)站

      nginx實(shí)現(xiàn)限流的方式有哪幾種

      nginx實(shí)現(xiàn)限流的方式有哪幾種

      通過查看nginx官方文檔可以得知,有三種nginx限流方式,分別是:

      (推薦教程:nginx教程)

      1、limit_conn_zone

      2、limit_req_zone

      3、ngx_http_upstream_module

      這里簡單的介紹一下以上三種方式:

      一、limit_conn_zone

      nginx配置

      http{   limit_conn_zone $binary_remote_addr zone=one:10m;   server   {     ......    limit_conn one 10;    ......   }  }

      其中“l(fā)imit_conn one 10”既可以放在server層對整個server有效,也可以放在location中只對單獨(dú)的location有效。
      該配置表明:客戶端的并發(fā)連接數(shù)只能是10個。

      二、limit_req_zone

      nginx配置

      http{   limit_req_zone $binary_remote_addr zone=req_one:10m rate=1r/s;   server   {     ......    limit_req zone=req_one burst=120;    ......   }  }

      其中“l(fā)imit_req zone=req_one burst=120”既可以放在server層對整個server有效,也可以放在location中只對單獨(dú)的location有效。

      rate=1r/s的意思是每個地址每秒只能請求一次,也就是說令牌桶burst=120一共有120塊令牌,并且每秒鐘只新增1塊令牌,120塊令牌發(fā)完后,多出來的請求就會返回503.。

      三、ngx_http_upstream_module

      nginx配置

      upstream xxxx{     server 127.0.0.1:8080 max_conns=10;     server 127.0.0.1:8081 max_conns=10;    }

      贊(0)
      分享到: 更多 (0)
      網(wǎng)站地圖   滬ICP備18035694號-2    滬公網(wǎng)安備31011702889846號