Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding circuit breaker and timeout layers to avoid Gateway 5xx errors. #39

Merged
merged 1 commit into from
Nov 14, 2024
Merged
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
3 changes: 3 additions & 0 deletions pkg/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
## Quickstart

### Requirements
The current manifests rely on Envoy Gateway [v1.2.1](https://gateway.envoyproxy.io/docs/install/install-yaml/#install-with-yaml) or higher.

### Steps

1. **Deploy Sample vLLM Application**
Expand Down
12 changes: 11 additions & 1 deletion pkg/manifests/ext_proc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,17 @@ spec:
request:
body: Buffered
response:
messageTimeout: 5s
# The timeouts are likely not needed here. We can experiment with removing/tuning them slowly.
# The connection limits are more important and will cause the opaque: ext_proc_gRPC_error_14 error in Envoy GW if not configured correctly.
messageTimeout: 1000s
backendSettings:
circuitBreaker:
maxConnections: 40000
maxPendingRequests: 40000
maxParallelRequests: 40000
timeout:
tcp:
connectTimeout: 24h
targetRef:
group: gateway.networking.k8s.io
kind: HTTPRoute
Expand Down
5 changes: 4 additions & 1 deletion pkg/manifests/gateway.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,7 @@ spec:
- backendRefs:
- group: gateway.envoyproxy.io
kind: Backend
name: backend-dummy
name: backend-dummy
timeouts:
request: "24h"
backendRequest: "24h"
7 changes: 6 additions & 1 deletion pkg/manifests/patch_policy.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,14 @@ spec:
original_dst_lb_config:
use_http_header: true
http_header_name: "target-pod"
connect_timeout: 6s
connect_timeout: 1000s
lb_policy: CLUSTER_PROVIDED
dns_lookup_family: V4_ONLY
circuit_breakers:
thresholds:
- max_connections: 40000
max_pending_requests: 40000
max_requests: 40000

- type: "type.googleapis.com/envoy.config.route.v3.RouteConfiguration"
name: default/<GATEWAY-NAME>/llm-gw
Expand Down
16 changes: 16 additions & 0 deletions pkg/manifests/traffic_policy.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: gateway.envoyproxy.io/v1alpha1
kind: BackendTrafficPolicy
metadata:
name: high-connection-route-policy
spec:
targetRefs:
- group: gateway.networking.k8s.io
kind: HTTPRoute
name: llm-route
circuitBreaker:
maxConnections: 40000
maxPendingRequests: 40000
maxParallelRequests: 40000
timeout:
tcp:
connectTimeout: 24h