控制 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]