Browse Source

optimize nginx config for openresty (#5308)

Vikash Tiwari 5 years ago
parent
commit
b6d4ec1df5
1 changed files with 13 additions and 2 deletions
  1. 13 2
      frameworks/Lua/openresty/nginx.conf

+ 13 - 2
frameworks/Lua/openresty/nginx.conf

@@ -1,14 +1,25 @@
+worker_cpu_affinity auto;
 pid        /tmp/nginx.pid;
 error_log stderr error;
+worker_rlimit_nofile 1024000;
+timer_resolution 1000ms;
 daemon off;
 
 events {
-    worker_connections  16384;
+    worker_connections 1000000;
 }
 
 http {
     resolver 127.0.0.1;
     access_log off;
+    server_tokens off;
+    msie_padding off;
+    sendfile off; #default
+    tcp_nopush off; #default
+    tcp_nodelay on; #default
+    keepalive_timeout 65;
+    keepalive_disable none;
+    keepalive_requests 1000000;
     lua_package_path '/openresty/?.lua;;';
     init_by_lua_block {
         jit.opt.start("minstitch=10")
@@ -19,7 +30,7 @@ http {
     }
 
     server {
-        listen       8080;
+        listen       8080 backlog=65535 reuseport;
         location /plaintext {
             default_type "text/plain";
             content_by_lua_block {