This commit is contained in:
Zsolt Ero
2023-12-20 04:29:25 +01:00
parent d8f96bf4e9
commit b467f0b33c
6 changed files with 65 additions and 85 deletions

View File

@@ -2,21 +2,22 @@
user nginx;
pid /var/run/nginx.pid;
# universal
worker_processes auto;
worker_rlimit_nofile 100000;
worker_rlimit_nofile 300000; # needs to be < ulimit -n
error_log /data/nginx/logs/nginx-error.log warn;
events {
worker_connections 8000;
worker_connections 40000;
multi_accept on;
}
http {
open_file_cache max=200000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
# aggressive caching for read-only sources
open_file_cache max=1000000 inactive=60m;
open_file_cache_valid 60m;
open_file_cache_min_uses 1;
open_file_cache_errors on;
server_tokens off;
@@ -28,23 +29,16 @@ http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
reset_timedout_connection on;
client_body_timeout 10;
send_timeout 2;
keepalive_timeout 30;
keepalive_requests 100000;
send_timeout 20;
max_ranges 0;
gzip on;
gzip_comp_level 1;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
gzip_types
text/plain;
gzip_types application/json;
log_format access_json '{'
'"time": "$time_iso8601", '
@@ -68,7 +62,7 @@ http {
'"http_host": "$http_host"'
'}';
access_log /data/nginx/logs/nginx-access.log access_json;
access_log /data/nginx/logs/nginx-access.log access_json buffer=32k;
include /data/nginx/config/*;
include /data/nginx/sites/*;

View File

@@ -1,4 +1,3 @@
vm.swappiness = 1
net.core.somaxconn = 65535
fs.file-max = 100000