因爲經過nginx做爲負載均衡服務,在訪問併發數量達到必定量級時jmeter報錯。 nginx日誌關鍵信息:accept4() failed (24: Too many open files)。 此日誌引發緣由是nginx進程打開文件數過多。度娘一堆相似的帖子這裏引用網上的解決方式比太實用 同時出現一些502 504nginx假死問題。考慮經過增長nginx工做進程數解決。
經過配置修改ulimit -n的值,由於結合docker-compose的方式使用nginx想到對應配置
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工做進程數配置方案引用html