Skip to content

Commit 5e63e03

Browse files
committed
perf(envoy): only log when status code >=400
Quick checks using the simple-update k6 benchmark from https://github.com/thebengeu/simple-supabase-benchmarks on t4g.nano, with SCALE=30 and 100 VUs over 3 minutes: - Kong: 442 rps, req duration med=129ms p(90)=410ms p(95)=668ms - Envoy log all: 613 rps, req duration med=155ms p(90)=207ms p(95)=250ms - Envoy log errors: 761 rps, req duration med=126ms, p(90)=154ms, p(95)=179ms So on this benchmark, this change results in ~24% more rps than Envoy logging all requests, ~72% more rps than Kong. Kong is also configured to only log errors, `proxy_access_log = off` here: https://github.com/supabase/postgres/blob/a3938dc906010ce197c240d0052b3eda9ecac339/docker/all-in-one/etc/kong/kong.conf#L12.
1 parent c7e3319 commit 5e63e03

File tree

1 file changed

+8
-27
lines changed

1 file changed

+8
-27
lines changed

ansible/files/envoy_config/lds.yaml

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -13,36 +13,16 @@ resources:
1313
type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager
1414
access_log:
1515
- name: envoy.file_access_log
16+
filter:
17+
status_code_filter:
18+
comparison:
19+
op: GE
20+
value:
21+
default_value: 400
22+
runtime_key: unused
1623
typed_config:
1724
'@type': >-
1825
type.googleapis.com/envoy.extensions.access_loggers.file.v3.FileAccessLog
19-
log_format:
20-
json_format:
21-
authority: '%REQ(:AUTHORITY)%'
22-
bytes_received: '%BYTES_RECEIVED%'
23-
bytes_sent: '%BYTES_SENT%'
24-
connection_termination_details: '%CONNECTION_TERMINATION_DETAILS%'
25-
downstream_local_address: '%DOWNSTREAM_LOCAL_ADDRESS%'
26-
downstream_remote_address: '%DOWNSTREAM_REMOTE_ADDRESS%'
27-
duration: '%DURATION%'
28-
method: '%REQ(:METHOD)%'
29-
path: '%REQ(X-ENVOY-ORIGINAL-PATH?:PATH)%'
30-
protocol: '%PROTOCOL%'
31-
request_id: '%REQ(X-REQUEST-ID)%'
32-
requested_server_name: '%REQUESTED_SERVER_NAME%'
33-
response_code: '%RESPONSE_CODE%'
34-
response_code_details: '%RESPONSE_CODE_DETAILS%'
35-
response_flags: '%RESPONSE_FLAGS%'
36-
route_name: '%ROUTE_NAME%'
37-
start_time: '%START_TIME%'
38-
upstream_cluster: '%UPSTREAM_CLUSTER%'
39-
upstream_host: '%UPSTREAM_HOST%'
40-
upstream_local_address: '%UPSTREAM_LOCAL_ADDRESS%'
41-
upstream_remote_address: '%UPSTREAM_REMOTE_ADDRESS%'
42-
upstream_service_time: '%RESP(X-ENVOY-UPSTREAM-SERVICE-TIME)%'
43-
upstream_transport_failure_reason: '%UPSTREAM_TRANSPORT_FAILURE_REASON%'
44-
user_agent: '%REQ(USER-AGENT)%'
45-
x_forwarded_for: '%REQ(X-FORWARDED-FOR)%'
4626
path: /dev/stdout
4727
generate_request_id: false
4828
http_filters:
@@ -331,3 +311,4 @@ resources:
331311
filename: /etc/envoy/fullChain.pem
332312
private_key:
333313
filename: /etc/envoy/privKey.pem
314+

0 commit comments

Comments
 (0)