Browse Source

Nginx use socket sharding and cpu affinity (#4256)

* Use socket sharding and cpu affinity

* Force header

* Update to ubuntu 18.10

* Correct add_header

* Revert to default_type
Joan Miquel 6 years ago
parent
commit
35ffa2942f
2 changed files with 5 additions and 5 deletions
  1. 4 4
      frameworks/C/nginx/nginx.conf
  2. 1 1
      frameworks/C/nginx/nginx.dockerfile

+ 4 - 4
frameworks/C/nginx/nginx.conf

@@ -1,5 +1,6 @@
 user www-data;
 worker_processes  auto;
+worker_cpu_affinity auto;
 error_log stderr error;
 worker_rlimit_nofile 200000;
 daemon off;
@@ -21,8 +22,7 @@ http {
     keepalive_timeout 65;
 
     server {
-        listen       8080;
-        server_name  localhost;
+        listen       8080 bind reuseport;
 
         root /;
         
@@ -32,8 +32,8 @@ http {
         }
 
         location /hello {
-          default_type text/plain;
-          return 200 "Hello, World!";
+            default_type text/plain;
+            return 200 "Hello, World!";
         }
     }
 }

+ 1 - 1
frameworks/C/nginx/nginx.dockerfile

@@ -1,4 +1,4 @@
-FROM ubuntu:16.04
+FROM ubuntu:18.10
 
 ARG DEBIAN_FRONTEND=noninteractive