2.2K Star 14K Fork 5.9K

GVP小柒2012/spring-boot-seckill

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
nginx.conf 1.07 KB
一键复制 编辑 原始数据 按行查看 历史
小柒2012 提交于 2018-06-10 17:12 . 分布式限流
#统一在http域中进行配置
#限制请求
limit_req_zone $binary_remote_addr $uri zone=api_read:20m rate=50r/s;
#按ip配置一个连接 zone
limit_conn_zone $binary_remote_addr zone=perip_conn:10m;
#按server配置一个连接 zone
limit_conn_zone $server_name zone=perserver_conn:100m;
server {
listen 80;
server_name seckill.52itstyle.com;
index index.jsp;
location / {
#请求限流排队通过 burst默认是0
limit_req zone=api_read burst=5;
#连接数限制,每个IP并发请求为2
limit_conn perip_conn 2;
#服务所限制的连接数(即限制了该server并发连接数量)
limit_conn perserver_conn 1000;
#连接限速
limit_rate 100k;
proxy_pass http://seckill;
}
}
# 负载集群配置
upstream seckill {
fair;
server 172.16.1.120:8080 weight=1 max_fails=2 fail_timeout=30s;
server 172.16.1.130:8080 weight=1 max_fails=2 fail_timeout=30s;
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/52itstyle/spring-boot-seckill.git
git@gitee.com:52itstyle/spring-boot-seckill.git
52itstyle
spring-boot-seckill
spring-boot-seckill
master

搜索帮助

Cb406eda 1850385 E526c682 1850385