浏览代码

Add worker_connections to config file

ithewei 3 年之前
父节点
当前提交
8e7f441dcc
共有 2 个文件被更改,包括 9 次插入0 次删除
  1. 3 0
      etc/httpd.conf
  2. 6 0
      examples/httpd/httpd.cpp

+ 3 - 0
etc/httpd.conf

@@ -18,6 +18,9 @@ worker_threads = 1
 # Disable multi-processes mode for debugging
 # worker_processes = 0
 
+# max_connections = workers * worker_connections
+worker_connections = 1024
+
 # http server
 http_port = 8080
 https_port = 8443

+ 6 - 0
examples/httpd/httpd.cpp

@@ -117,6 +117,12 @@ int parse_confile(const char* confile) {
     }
     g_http_server.worker_threads = LIMIT(0, worker_threads, 64);
 
+    // worker_connections
+    str = ini.GetValue("worker_connections");
+    if (str.size() != 0) {
+        g_http_server.worker_connections = atoi(str.c_str());
+    }
+
     // http_port
     int port = 0;
     const char* szPort = get_arg("p");