reuseport 负载均衡 [nginx>1.9]
最后更新于:2022-04-02 02:54:41
[TOC]
## 概述
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/86/b6/86b6c4066d2416b85041edacf886d37c_1080x273.png)
如果发现图片的运行时间(TIMES)不均匀
可以设置为 reuseport 负载均衡
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/10/89/1089e342317c2079ef676541df1f7151_1080x274.png)
## 性能
![](https://docs.gechiui.com/gc-content/uploads/sites/kancloud/e9/c8/e9c8172befd656970c40e9f8f74debeb_595x333.png)
比较三种NGINX配置:默认(等同于`accept_mutex on`),`accept_mutex off`和reuseport
## 实例
```
http {
server {
listen 80 reuseport;
...
}
}
```
';