Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 23 additions & 18 deletions installer/templates/front-end.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,46 +70,51 @@ server {
proxy_request_buffering off;
}

# The agent's persistent gRPC streams to agent-manager. nginx's
# grpc_*_timeout of 0 means "no inactivity timeout" (removing the
# directive would silently fall back to a 60s default), so an idle
# AgentStream / PingService / CollectorService is never torn down by the
# proxy. Liveness is carried by the gRPC keepalive (30s ping / 10s
# timeout on both ends) plus grpc_socket_keepalive, which still reaps a
# genuinely dead peer.
# The agent's persistent gRPC streams to agent-manager. nginx has no
# "no timeout" for upstream read/send (0 means "fire immediately", which
# breaks every request), so use a large inactivity backstop of 24h.
# gRPC keepalive PINGs are HTTP/2 control frames - nginx only ACKs them
# and they do NOT reset these timers; only DATA does. Every timer below
# must therefore be large for streams legitimately silent between calls.
location /agent.AgentService/ {
grpc_pass grpcs://$utmstack_agent_manager_grpc;
grpc_read_timeout 0;
grpc_send_timeout 0;
client_body_timeout 1h;
grpc_read_timeout 86400;
grpc_send_timeout 86400;
client_body_timeout 86400;
grpc_socket_keepalive on;
}

location /agent.PanelService/ {
grpc_pass grpcs://$utmstack_agent_manager_grpc;
grpc_read_timeout 0;
grpc_send_timeout 0;
grpc_read_timeout 86400;
grpc_send_timeout 86400;
client_body_timeout 86400;
grpc_socket_keepalive on;
}

location /agent.CollectorService/ {
grpc_pass grpcs://$utmstack_agent_manager_grpc;
grpc_read_timeout 0;
grpc_send_timeout 0;
grpc_read_timeout 86400;
grpc_send_timeout 86400;
client_body_timeout 86400;
grpc_socket_keepalive on;
}

# log-input's ingest, whose service lives in the SDK's "plugins" package.
# log-input's ingest: also a persistent collector stream, so the same
# 24h inactivity backstop (a quiet host can go >60s without a log line).
location /plugins.Integration/ {
grpc_pass grpcs://$utmstack_log_input_grpc;
grpc_read_timeout 900;
grpc_send_timeout 900;
grpc_read_timeout 86400;
grpc_send_timeout 86400;
client_body_timeout 86400;
}

location /agent.PingService/ {
grpc_pass grpcs://$utmstack_agent_manager_grpc;
grpc_read_timeout 0;
grpc_send_timeout 0;
grpc_read_timeout 86400;
grpc_send_timeout 86400;
client_body_timeout 86400;
grpc_socket_keepalive on;
}

Expand Down
36 changes: 28 additions & 8 deletions installer/templates/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,27 @@ server {
location /agent. {
grpc_pass grpc://127.0.0.1:10001;
grpc_set_header x-shared-key $shared_key;
grpc_read_timeout 900;
grpc_send_timeout 900;
# Long-lived agent streams: nginx's gRPC keepalive PINGs are HTTP/2
# control frames and do NOT reset these timers; only DATA does.
# An AgentStream is pure DATA between commands, so the 60s-default
# client_body_timeout (request body inactivity) is what evicted idle
# agents at exactly 60s. Use a 24h inactivity backstop; liveness is
# the app's job (gRPC keepalive + TCP keepalive).
grpc_read_timeout 86400;
grpc_send_timeout 86400;
client_body_timeout 86400;
}

# log-input's ingest. Separate only because its proto package differs; the
# router behind decides which of the two it is.
location /plugins. {
grpc_pass grpc://127.0.0.1:10001;
grpc_set_header x-shared-key $shared_key;
grpc_read_timeout 900;
grpc_send_timeout 900;
# Same long-lived-stream treatment: a quiet collector can easily go
# more than 60s without a single log line on the stream.
grpc_read_timeout 86400;
grpc_send_timeout 86400;
client_body_timeout 86400;
}

location / {
Expand Down Expand Up @@ -105,17 +115,27 @@ server {
location /agent. {
grpc_pass grpc://127.0.0.1:10001;
grpc_set_header x-shared-key $shared_key;
grpc_read_timeout 900;
grpc_send_timeout 900;
# Long-lived agent streams: nginx's gRPC keepalive PINGs are HTTP/2
# control frames and do NOT reset these timers; only DATA does.
# An AgentStream is pure DATA between commands, so the 60s-default
# client_body_timeout (request body inactivity) is what evicted idle
# agents at exactly 60s. Use a 24h inactivity backstop; liveness is
# the app's job (gRPC keepalive + TCP keepalive).
grpc_read_timeout 86400;
grpc_send_timeout 86400;
client_body_timeout 86400;
}

# log-input's ingest. Separate only because its proto package differs; the
# router behind decides which of the two it is.
location /plugins. {
grpc_pass grpc://127.0.0.1:10001;
grpc_set_header x-shared-key $shared_key;
grpc_read_timeout 900;
grpc_send_timeout 900;
# Same long-lived-stream treatment: a quiet collector can easily go
# more than 60s without a single log line on the stream.
grpc_read_timeout 86400;
grpc_send_timeout 86400;
client_body_timeout 86400;
}

location / {
Expand Down
Loading