Envoy internals
- Main and worker ownership, connections and streams, filter processing, upstream pools, responses and TCP alternatives.
Select a component to trace its direct connections. Drag to pan · Ctrl + wheel or pinch to zoom.
- A downstream connection is the client connection into Envoy. One worker owns it for its lifetime. On HTTP/2, several request streams on that connection can be active on the same worker.
- For each stream, the HTTP connection manager applies filters and selects a route. The router sends the request through an upstream connection pool. A filter can also answer the client locally.
Reading
Process, workers and connection lifetime
Process, workers and connection lifetime
- The main thread coordinates configuration, lifecycle, administration and stats flushing. Workers own traffic-processing event loops.
- One established downstream TCP connection and its multiplexed HTTP streams stay on one worker for the connection lifetime.
- Worker count is neither an admitted-request allowance nor a thread-per-request model. Auxiliary threads and optional extensions are omitted from this generic source view.
Listener and selected filter chain
Listener and selected filter chain
- TCP accept is followed by listener filters and selection of one filter chain. TLS inspector extracts matching information and does not terminate TLS.
- The selected transport socket supplies plaintext or decrypted bytes to the network filters. HCM is a network filter inside that connection path, not a separate service.
- UDP, QUIC and HTTP/3 need different transport paths; this TCP/HTTP source diagram does not route them through TCP accept.
HTTP codec and per-stream filters
HTTP codec and per-stream filters
- The HCM codec interprets HTTP/1.1 or HTTP/2 and creates streams. Each request stream has its own HTTP filter chain.
- Decoder filters lead to the router; the router joins downstream HTTP processing to the upstream cluster subsystem.
- The route table is a configuration side input, delivered inline or through RDS. Route lookup is not another network hop.
Cluster view, host selection and pools
Cluster view, host selection and pools
- The worker uses its thread-local cluster view, chooses a host and acquires capacity from the appropriate connection pool.
- Connection pools are worker-local and further partitioned by host, protocol and priority. Cluster resource limits are not independent per-worker budgets.
- The upstream HTTP codec and transport socket are separate from their downstream counterparts.
Response encoding and local replies
Response encoding and local replies
- HTTP responses pass through encoder processing in the reverse direction. A stopped request decoder path can still produce an encoded local response.
- Upstream allocation failure and filter-generated local replies have different causes and resource accounting.
- Admin/export is ancillary; stats updates and access-log generation still occur during request or lifecycle processing. Telemetry has processing cost.
Raw TCP alternative
Raw TCP alternative
- A selected tcp_proxy network-filter path bypasses HCM and HTTP route/filter processing.
- It still selects a cluster/host and obtains TCP upstream capacity. Opaque application HTTPS does not become visible HTTP merely by forwarding it.