zoukankan      html  css  js  c++  java
  • nginx 几个参数

    worker_processes :

    When set to 'auto', which is also the default behavior, Tengine will create the same number of worker processes as your CPUs.

    worker_cpu_affinity:
    When set to 'auto', Tengine will automatically bind each worker process to a specific CPU. If the number of worker processes is larger than the number of your CPUs, then the rest of worker processes will be bond in descendant order. For example, if there are 8 CPUs in your system:

     worker_rlimit_nofile:

    每个nginx进程打开文件描述符最大数目 配置要和系统的单进程打开文件数一致,linux 2.6内核下开启文件打开数为65535,worker_rlimit_nofile就相应应该填写65535

    use epoll

    Nginx使用了最新的epoll(Linux 2.6内核)和kqueue(freebsd)网络I/O模

    型,而Apache则使用的是传统的select模型。
    处理大量的连接的读写,Apache所采用的select网络I/O模型非常低效。
    在高并发服务器中,轮询I/O是最耗时间的操作 目前Linux下能够承受高并发

    访问的Squid、Memcached都采用的是epoll网络I/O模型。

    worker_connections 65535;
    每个工作进程允许最大的同时连接数  (Maxclient = work_processes * worker_connections)

    client_header_buffer_size 16k
    large_client_header_buffers 4 32k

    客户请求头缓冲大小 
    nginx默认会用client_header_buffer_size这个buffer来读取header值,如果header过大,它会使用large_client_header_buffers来读取

     

  • 相关阅读:
    CentOS Linux下VNC Server远程桌面配置详解
    Java 中的悲观锁和乐观锁的实现
    spring @configuration使用
    MySQL 汉字拼音
    chmod用数字来表示权限的方法
    C语言创建删不掉的目录
    Android小经验
    系统清理——查找大文件
    最全Pycharm教程(42)——Pycharm扩展功能之Emacs外部编辑器
    怎样学习程序
  • 原文地址:https://www.cnblogs.com/allenhaozi/p/5333553.html
Copyright © 2011-2022 走看看