zoukankan      html  css  js  c++  java
  • nginx 配置

    1.worker_processes:

    工作进程数量,一般这个配置成 和cpu的线程数一致。

    比如双核4线程就配置为4

    2.too many open files 错误

    如果NGINX的error.log出现大量的Too many open files,说明文件句柄不够用了,这时候我们需要加大系统的文件句柄数和nginx的允许最大的连接数。

    编辑

    /etc/security/limits.conf

    增加设置

    * soft nofile 65535 

    * hard nofile 65535

    编辑

    nginx.conf 

    worker_connections:1024

    每个进程允许的最多连接数,理论上每台nginx服务器的最大连接数为worker_processes*worker_connections。

    这个值默认为1024 ,在生产环境下配置成 102400.

    改完后,重启机器。

  • 相关阅读:
    shell循环
    shell选择语句
    shell运算符
    shell变量
    前端基础复习
    flask 模板
    flask 会话技术
    flask 项目结构
    Tornado 框架介绍
    flask-models 操作
  • 原文地址:https://www.cnblogs.com/yg_zhang/p/10771610.html
Copyright © 2011-2022 走看看