From 8e822b26915c5e39fc1f8f878f1645b7b7c2dc60 Mon Sep 17 00:00:00 2001 From: Joanhey Date: Thu, 10 Nov 2022 20:34:58 +0100 Subject: [PATCH 1/2] Initial optimized nginx configs --- conf/nginx/optimized/html | 12 +++++------- conf/nginx/optimized/proxy | 14 +++++++------- conf/nginx/optimized/synthetic | 12 +++++------- 3 files changed, 17 insertions(+), 21 deletions(-) diff --git a/conf/nginx/optimized/html b/conf/nginx/optimized/html index 85b33b6..446b99c 100644 --- a/conf/nginx/optimized/html +++ b/conf/nginx/optimized/html @@ -1,21 +1,19 @@ +worker_processes auto; # default 1 +error_log stderr error; # default to logs/error.log + events { - use epoll; - worker_connections 1024; + #use epoll; by default use the best option + worker_connections 2500; # default 512 } -worker_processes auto; - http { access_log off; sendfile on; - proxy_cache_path /tmp/nginx-cache keys_zone=cache:10m; server { listen 0.0.0.0:8080; - proxy_cache cache; location / { - alias /srv/static/; } } } diff --git a/conf/nginx/optimized/proxy b/conf/nginx/optimized/proxy index 0652db9..7195d99 100644 --- a/conf/nginx/optimized/proxy +++ b/conf/nginx/optimized/proxy @@ -1,21 +1,21 @@ +worker_processes auto; # default 1 +error_log stderr error; # default to logs/error.log + events { - use epoll; - worker_connections 1024; + #use epoll; by default use the best option + worker_connections 2500; # default 512 } -worker_processes auto; - http { access_log off; - sendfile on; - proxy_cache_path /tmp/nginx-cache keys_zone=cache:10m; server { listen 0.0.0.0:8080; - proxy_cache cache; location / { proxy_pass http://127.0.0.1:8081; + proxy_http_version 1.1; + proxy_set_header Connection ""; } } } diff --git a/conf/nginx/optimized/synthetic b/conf/nginx/optimized/synthetic index a53bae9..421258c 100644 --- a/conf/nginx/optimized/synthetic +++ b/conf/nginx/optimized/synthetic @@ -1,18 +1,16 @@ +worker_processes auto; # default 1 +error_log stderr error; # default to logs/error.log + events { - use epoll; - worker_connections 1024; + #use epoll; # by default use the best option + worker_connections 2500; # default 512 } -worker_processes auto; - http { access_log off; - sendfile on; - proxy_cache_path /tmp/nginx-cache keys_zone=cache:10m; server { listen 0.0.0.0:8080; - proxy_cache cache; return 200 "Hello, world!"; } From 384a8e514117d22b5fade2b94324204a68f206f9 Mon Sep 17 00:00:00 2001 From: Joanhey Date: Thu, 10 Nov 2022 21:11:51 +0100 Subject: [PATCH 2/2] Add keepalive reqs --- conf/nginx/optimized/html | 2 ++ conf/nginx/optimized/proxy | 2 ++ conf/nginx/optimized/synthetic | 2 ++ 3 files changed, 6 insertions(+) diff --git a/conf/nginx/optimized/html b/conf/nginx/optimized/html index 446b99c..ce0a569 100644 --- a/conf/nginx/optimized/html +++ b/conf/nginx/optimized/html @@ -1,6 +1,8 @@ worker_processes auto; # default 1 error_log stderr error; # default to logs/error.log +keepalive_requests 10000; + events { #use epoll; by default use the best option worker_connections 2500; # default 512 diff --git a/conf/nginx/optimized/proxy b/conf/nginx/optimized/proxy index 7195d99..6b61ce7 100644 --- a/conf/nginx/optimized/proxy +++ b/conf/nginx/optimized/proxy @@ -1,6 +1,8 @@ worker_processes auto; # default 1 error_log stderr error; # default to logs/error.log +keepalive_requests 10000; + events { #use epoll; by default use the best option worker_connections 2500; # default 512 diff --git a/conf/nginx/optimized/synthetic b/conf/nginx/optimized/synthetic index 421258c..212d6de 100644 --- a/conf/nginx/optimized/synthetic +++ b/conf/nginx/optimized/synthetic @@ -1,6 +1,8 @@ worker_processes auto; # default 1 error_log stderr error; # default to logs/error.log +keepalive_requests 10000; + events { #use epoll; # by default use the best option worker_connections 2500; # default 512