1.问题产生原因:

由于通过nginx作为负载均衡服务,在访问并发数量达到一定量级时jmeter报错。
nginx日志关键信息:accept4() failed (24: Too many open files)。
此日志引起原因是nginx进程打开文件数过多。度娘一堆类似的帖子这里引用网上的解决方式比太实用
同时出现一些502 504nginx假死问题。考虑通过增加nginx工作进程数解决。

2.解决思路:

通过配置修改ulimit -n的值,因为结合docker-compose的方式使用nginx想到对应配置

3.解决方法:

nginx:
restart: always
image: nginx
container_name: nginx
ports:
  - 80:80
volumes:
  - ./conf/nginx.conf:/etc/nginx/nginx.conf
  - ./wwwroot:/usr/share/nginx/wwwroot
ulimits:
  nproc: 65535
  nofile:
    soft: 65535
    hard: 65535

引用:引用博文
nginx工作进程数配置方案引用

相关文章:

  • 2022-01-05
  • 2021-11-28
  • 2021-10-16
  • 2021-07-25
猜你喜欢
  • 2022-12-23
  • 2021-11-13
  • 2021-07-14
  • 2021-09-22
  • 2022-12-23
  • 2022-01-07
  • 2021-12-14
相关资源
相似解决方案