Envoy는 Lyft가 개발한 고성능 L7 프록시이자 통신 버스로, 서비스 메시(Istio, AWS App Mesh)의 데이터 플레인으로 널리 사용된다. C++ 기반으로 매우 낮은 레이턴시를 제공한다.
Envoy 핵심 아키텍처
┌──────────────────────────────┐
다운스트림 ──→ │ Listener → Filter Chain │ ──→ 업스트림 클러스터
│ (HCM → Router → Cluster) │
└──────────────────────────────┘
xDS API
(동적 설정 갱신)
정적 설정 (envoy.yaml)
yaml
static_resources:
listeners:
- name: listener_0
address:
socket_address: { address: 0.0.0.0, port_value: 10000 }
filter_chains:
- filters:
- name: envoy.filters.network.http_connection_manager
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
stat_prefix: ingress_http
route_config:
name: local_route
virtual_hosts:
- name: backend
domains: ["*"]
routes:
- match: { prefix: "/api/orders" }
route:
cluster: order_service
timeout: 5s
retry_policy:
retry_on: "5xx,gateway-error,connect-failure"
num_retries: 3
http_filters:
- name: envoy.filters.http.router
typed_config:
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router
clusters:
- name: order_service
connect_timeout: 1s
type: STRICT_DNS
lb_policy: ROUND_ROBIN
load_assignment:
cluster_name: order_service
endpoints:
- lb_endpoints:
- endpoint:
address:
socket_address: { address: order-service, port_value: 8080 }
health_checks:
- timeout: 1s
interval: 5s
http_health_check: { path: "/health" }
서킷 브레이커
yaml
circuit_breakers:
thresholds:
- priority: DEFAULT
max_connections: 100
max_pending_requests: 50
max_requests: 200
max_retries: 3
Envoy vs Nginx vs HAProxy
| 항목 | Envoy | Nginx | HAProxy |
|---|
| 동적 설정 | xDS API | 리로드 필요 | 런타임 API |
| 관찰성 | 내장 (메트릭/트레이싱) | 기본 | 기본 |
| L7 기능 | 풍부 (gRPC, HTTP/2) | 풍부 | 제한적 |
| 서비스 메시 | 표준 | 제한적 | 없음 |
| 성능 | 높음 | 매우 높음 | 매우 높음 |