-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathperformance.nginx.conf
More file actions
60 lines (52 loc) · 2.49 KB
/
performance.nginx.conf
File metadata and controls
60 lines (52 loc) · 2.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
# StellarEscrow — Nginx Performance Tuning
# Include in the http {} block of nginx.conf:
# include /etc/nginx/conf.d/performance.conf;
# ── Worker processes ──────────────────────────────────────────────────────────
worker_processes auto;
worker_rlimit_nofile 65535;
events {
worker_connections 4096;
use epoll;
multi_accept on;
}
http {
# ── Connection keep-alive ─────────────────────────────────────────────────
keepalive_timeout 65;
keepalive_requests 1000;
# ── Compression ───────────────────────────────────────────────────────────
gzip on;
gzip_comp_level 5;
gzip_min_length 256;
gzip_proxied any;
gzip_vary on;
gzip_types
application/javascript
application/json
application/wasm
font/woff2
image/svg+xml
text/css
text/plain;
# ── Proxy buffering (for /api/ upstream) ──────────────────────────────────
proxy_buffering on;
proxy_buffer_size 8k;
proxy_buffers 16 8k;
proxy_busy_buffers_size 16k;
proxy_connect_timeout 5s;
proxy_read_timeout 30s;
proxy_send_timeout 30s;
# ── Open file cache ───────────────────────────────────────────────────────
open_file_cache max=10000 inactive=30s;
open_file_cache_valid 60s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
# ── TCP optimisations ─────────────────────────────────────────────────────
tcp_nopush on;
tcp_nodelay on;
sendfile on;
# ── Upstream connection pool to indexer ───────────────────────────────────
upstream indexer_pool {
server indexer:3000;
keepalive 32; # persistent connections to the Rust backend
}
}