当前位置: 代码迷 >> 综合 >> nignx:maximum number of descriptors supported by select() is 1024 while connecting to upstream
  详细解决方案

nignx:maximum number of descriptors supported by select() is 1024 while connecting to upstream

热度:64   发布时间:2024-02-19 15:44:22.0

文章目录

    • 背景
    • 问题
    • 解决方式

背景

测试在用jmeter进行压力测试,在并发量高的时候,出现接口时而正常时而失败的情况。并发量低没有问题。
版本:window

问题

nginx log报错:
maximum number of descriptors supported by select() is 1024 while connecting to upstream
maximum number of descriptors supported by select() is 1024 while waiting for request
在这里插入图片描述

解决方式

在这里插入图片描述
首先看一下nginx.conf配置文件。网上搜索解决办法的时候:有人说
1.修改参数worker_connections
2.修改参数worker_rlimit_nofile
但是我本来就设置的65535,连接已经够大了。还是这个问题。
没有设置这个的小伙伴可以尝试一下。
下面着重看一下设置了依然同样问题是如何解决的?

解决
1.去官网下载新版本的nginx
nginx for windows下载地址:http://nginx-win.ecsds.eu/download/
我用的这个版本
在这里插入图片描述

2.解压后在服务器上面双击执行解压后的Tweak-Optimize tcpip parameters for nginx connections.reg文件。修改注册表连接数配置信息
3.将解压目录的nginx_basic.exe更名为nginx.exe,拷贝到服务器上替换相应的nginx.exe程序。(服务器需停掉nginx再操作)
在这里插入图片描述

  相关解决方案