theoforce 发表于 2017-12-23 16:29:43

控制 Nginx 并发连接数

# cat /usr/local/nginx/conf/nginx.conf  ....
  
http {
  
include       mime.types;
  
default_typeapplication/octet-stream;
  
sendfile      on;
  
keepalive_timeout65;
  
limit_conn_zone $binary_remote_addr zone=addr:10m;    # 用于设置共享内存区域,addr 是共享内存区域的名称,10m 表示共享内存区域的大小
  
server {
  
listen       80;
  
server_namewww.abc.com;
  
location / {
  
root   html/www;
  
indexindex.html index.htm;
  
limit_conn addr 1;   # 限制单个IP的并发连接数为1
  
}
  
}
  
}
页: [1]
查看完整版本: 控制 Nginx 并发连接数