zoukankan      html  css  js  c++  java
  • Nginx http 500错误分析及解决方法


     
    出现场景:
     
    在用nginx做负载均衡服务器对系统做并发测试,并发量比较大时Nginx会报出Http 500错误
     
     
    报错原因:
     
    访问量大的时候,由于系统资源限制,而不能打开过多的文件
     
     
    原因查找:
     
    • 打开nginx错误日志(/usr/local/nginx/logs/error.log)
     
    • 查看是否报too many open files错误
     
     
    错误解决:
     
    • 打开/etc/security/limits.conf
    • 修改 limits.conf文件,加上下面两句命令
     
    * soft nofile 65535
    * hard nofile 65535
     
    • 打开/usr/local/nginx/conf/nginx.conf,在worker_processes的下面增加一行配置
     
    worker_rlimit_nofile 65535;
     
    • 重新启动nginx,问题解决
     
  • 相关阅读:
    9.4
    9.3
    9.2
    2016.9.1
    html,body
    prototype
    京东笔试题的一些小细节
    gulp安装过程中的问题。
    json
    双飞翼布局和圣杯布局
  • 原文地址:https://www.cnblogs.com/gdufs/p/6410373.html
Copyright © 2011-2022 走看看