zoukankan      html  css  js  c++  java
  • nginx 并发数问题思考:worker_connections,worker_processes与 max clients

    nginx 并发数问题思考:worker_connections,worker_processes与 max clients-运维者说:从菜鸟到老鸟-51CTO博客 https://blog.51cto.com/liuqunying/1420556

    nginx 并发数问题思考:worker_connections,worker_processes与 max clients

    Core functionality https://nginx.org/en/docs/ngx_core_module.html#worker_connections

    Core functionality https://nginx.org/en/docs/ngx_core_module.html#worker_connections

    Syntax: worker_connections number;
    Default:
    worker_connections 512;
    Context: events

    Sets the maximum number of simultaneous connections that can be opened by a worker process.

    It should be kept in mind that this number includes all connections (e.g. connections with proxied servers, among others), not only connections with clients. Another consideration is that the actual number of simultaneous connections cannot exceed the current limit on the maximum number of open files, which can be changed by worker_rlimit_nofile.

    nginx/ngx_event.c at master · nginx/nginx https://github.com/nginx/nginx/blob/master/src/event/ngx_event.c

    if (cycle->connection_n < cycle->listening.nelts + 1) {
       
      /*
      * there should be at least one connection for each listening
      * socket, plus an additional connection for channel
      */
       
      ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
      "%ui worker_connections are not enough "
      "for %ui listening sockets",
      cycle->connection_n, cycle->listening.nelts);
       
      return NGX_CONF_ERROR;
      }
    if (cycle->connection_n < cycle->listening.nelts + 1) {
       
      /*
      * there should be at least one connection for each listening
      * socket, plus an additional connection for channel
      */
       
      ngx_log_error(NGX_LOG_EMERG, cycle->log, 0,
      "%ui worker_connections are not enough "
      "for %ui listening sockets",
      cycle->connection_n, cycle->listening.nelts);
       
      return NGX_CONF_ERROR;
      }
  • 相关阅读:
    [K/3Cloud] 关于单据转换的问题
    [K/3Cloud] 分录行复制和新增行的冲突如何处理
    [K/3Cloud] 动态表单打开时传递一个自定义参数并在插件中获取
    [译]C++书籍终极推荐
    Time.deltaTime 含义和应用
    cocos2d-x 锚点,位置==》动手实验记录 多动手... :)
    iOS的主要框架介绍
    xcode 预编译头文件
    android 内部存储相关知识点: getfilestreampath getDir 子文件夹
    coco2d-js 多屏适配相关API
  • 原文地址:https://www.cnblogs.com/rsapaper/p/12833844.html
Copyright © 2011-2022 走看看