Skip to content

Commit 752687d

Browse files
jukierudrakhp
andauthored
Default to 1 for MaxAcceptPerSocketEvent (envoyproxy#6447)
* Add default=1 for MaxAcceptPerSocketEvent Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com> * testdata Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com> * Fix default Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com> * Update internal/xds/translator/listener.go Co-authored-by: Rudrakh Panigrahi <rudrakh97@gmail.com> Signed-off-by: Isaac <10012479+jukie@users.noreply.github.com> * update const name Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com> --------- Signed-off-by: jukie <10012479+Jukie@users.noreply.github.com> Signed-off-by: Isaac <10012479+jukie@users.noreply.github.com> Co-authored-by: Rudrakh Panigrahi <rudrakh97@gmail.com>
1 parent a394c61 commit 752687d

File tree

191 files changed

+320
-36
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

191 files changed

+320
-36
lines changed

api/v1alpha1/connection_types.go

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,11 @@ type ClientConnection struct {
3939

4040
// MaxAcceptPerSocketEvent provides configuration for the maximum number of connections to accept from the kernel
4141
// per socket event. If there are more than MaxAcceptPerSocketEvent connections pending accept, connections over
42-
// this threshold will be accepted in later event loop iterations. If no value is provided Envoy will accept
43-
// all connections pending accept from the kernel.
44-
// It is recommended to lower this value for better overload management and reduced per-event cost.
45-
// Setting it to 1 is a viable option with no noticeable impact on performance.
42+
// this threshold will be accepted in later event loop iterations.
43+
// Defaults to 1 and can be disabled by setting to 0 for allowing unlimited accepted connections.
4644
//
4745
// +optional
46+
// +kubebuilder:default=1
4847
MaxAcceptPerSocketEvent *uint32 `json:"maxAcceptPerSocketEvent,omitempty"`
4948
}
5049

charts/gateway-crds-helm/templates/generated/gateway.envoyproxy.io_clienttrafficpolicies.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -154,13 +154,12 @@ spec:
154154
- value
155155
type: object
156156
maxAcceptPerSocketEvent:
157+
default: 1
157158
description: |-
158159
MaxAcceptPerSocketEvent provides configuration for the maximum number of connections to accept from the kernel
159160
per socket event. If there are more than MaxAcceptPerSocketEvent connections pending accept, connections over
160-
this threshold will be accepted in later event loop iterations. If no value is provided Envoy will accept
161-
all connections pending accept from the kernel.
162-
It is recommended to lower this value for better overload management and reduced per-event cost.
163-
Setting it to 1 is a viable option with no noticeable impact on performance.
161+
this threshold will be accepted in later event loop iterations.
162+
Defaults to 1 and can be disabled by setting to 0 for allowing unlimited accepted connections.
164163
format: int32
165164
type: integer
166165
socketBufferLimit:

charts/gateway-helm/crds/generated/gateway.envoyproxy.io_clienttrafficpolicies.yaml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,13 +153,12 @@ spec:
153153
- value
154154
type: object
155155
maxAcceptPerSocketEvent:
156+
default: 1
156157
description: |-
157158
MaxAcceptPerSocketEvent provides configuration for the maximum number of connections to accept from the kernel
158159
per socket event. If there are more than MaxAcceptPerSocketEvent connections pending accept, connections over
159-
this threshold will be accepted in later event loop iterations. If no value is provided Envoy will accept
160-
all connections pending accept from the kernel.
161-
It is recommended to lower this value for better overload management and reduced per-event cost.
162-
Setting it to 1 is a viable option with no noticeable impact on performance.
160+
this threshold will be accepted in later event loop iterations.
161+
Defaults to 1 and can be disabled by setting to 0 for allowing unlimited accepted connections.
163162
format: int32
164163
type: integer
165164
socketBufferLimit:

internal/cmd/egctl/testdata/translate/out/default-resources.all.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,6 +1090,7 @@ xds:
10901090
statPrefix: http-10080
10911091
useRemoteAddress: true
10921092
name: default/eg/http
1093+
maxConnectionsToAcceptPerSocketEvent: 1
10931094
name: default/eg/http
10941095
perConnectionBufferLimitBytes: 32768
10951096
- activeState:
@@ -1201,6 +1202,7 @@ xds:
12011202
statPrefix: http-8080
12021203
useRemoteAddress: true
12031204
name: default/eg/grpc
1205+
maxConnectionsToAcceptPerSocketEvent: 1
12041206
name: default/eg/grpc
12051207
perConnectionBufferLimitBytes: 32768
12061208
- activeState:
@@ -1284,6 +1286,7 @@ xds:
12841286
cluster: tcproute/default/backend/rule/-1
12851287
statPrefix: tcp-1234
12861288
name: tcproute/default/backend
1289+
maxConnectionsToAcceptPerSocketEvent: 1
12871290
name: default/eg/tcp
12881291
perConnectionBufferLimitBytes: 32768
12891292
- activeState:
@@ -1374,6 +1377,7 @@ xds:
13741377
- name: envoy.filters.listener.tls_inspector
13751378
typedConfig:
13761379
'@type': type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector
1380+
maxConnectionsToAcceptPerSocketEvent: 1
13771381
name: default/eg/tls-passthrough
13781382
perConnectionBufferLimitBytes: 32768
13791383
- activeState:

internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -912,6 +912,7 @@
912912
],
913913
"name": "default/eg/http"
914914
},
915+
"maxConnectionsToAcceptPerSocketEvent": 1,
915916
"name": "default/eg/http",
916917
"perConnectionBufferLimitBytes": 32768
917918
}
@@ -1063,6 +1064,7 @@
10631064
],
10641065
"name": "default/eg/grpc"
10651066
},
1067+
"maxConnectionsToAcceptPerSocketEvent": 1,
10661068
"name": "default/eg/grpc",
10671069
"perConnectionBufferLimitBytes": 32768
10681070
}
@@ -1174,6 +1176,7 @@
11741176
"name": "tcproute/default/backend"
11751177
}
11761178
],
1179+
"maxConnectionsToAcceptPerSocketEvent": 1,
11771180
"name": "default/eg/tcp",
11781181
"perConnectionBufferLimitBytes": 32768
11791182
}
@@ -1298,6 +1301,7 @@
12981301
}
12991302
}
13001303
],
1304+
"maxConnectionsToAcceptPerSocketEvent": 1,
13011305
"name": "default/eg/tls-passthrough",
13021306
"perConnectionBufferLimitBytes": 32768
13031307
}

internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.all.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -543,6 +543,7 @@ xds:
543543
statPrefix: http-10080
544544
useRemoteAddress: true
545545
name: default/eg/http
546+
maxConnectionsToAcceptPerSocketEvent: 1
546547
name: default/eg/http
547548
perConnectionBufferLimitBytes: 32768
548549
- activeState:
@@ -654,6 +655,7 @@ xds:
654655
statPrefix: http-8080
655656
useRemoteAddress: true
656657
name: default/eg/grpc
658+
maxConnectionsToAcceptPerSocketEvent: 1
657659
name: default/eg/grpc
658660
perConnectionBufferLimitBytes: 32768
659661
- activeState:
@@ -737,6 +739,7 @@ xds:
737739
cluster: tcproute/default/backend/rule/-1
738740
statPrefix: tcp-1234
739741
name: tcproute/default/backend
742+
maxConnectionsToAcceptPerSocketEvent: 1
740743
name: default/eg/tcp
741744
perConnectionBufferLimitBytes: 32768
742745
- activeState:
@@ -827,6 +830,7 @@ xds:
827830
- name: envoy.filters.listener.tls_inspector
828831
typedConfig:
829832
'@type': type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector
833+
maxConnectionsToAcceptPerSocketEvent: 1
830834
name: default/eg/tls-passthrough
831835
perConnectionBufferLimitBytes: 32768
832836
- activeState:

internal/cmd/egctl/testdata/translate/out/from-gateway-api-to-xds.listener.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ xds:
142142
statPrefix: http-10080
143143
useRemoteAddress: true
144144
name: default/eg/http
145+
maxConnectionsToAcceptPerSocketEvent: 1
145146
name: default/eg/http
146147
perConnectionBufferLimitBytes: 32768
147148
- activeState:
@@ -253,6 +254,7 @@ xds:
253254
statPrefix: http-8080
254255
useRemoteAddress: true
255256
name: default/eg/grpc
257+
maxConnectionsToAcceptPerSocketEvent: 1
256258
name: default/eg/grpc
257259
perConnectionBufferLimitBytes: 32768
258260
- activeState:
@@ -336,6 +338,7 @@ xds:
336338
cluster: tcproute/default/backend/rule/-1
337339
statPrefix: tcp-1234
338340
name: tcproute/default/backend
341+
maxConnectionsToAcceptPerSocketEvent: 1
339342
name: default/eg/tcp
340343
perConnectionBufferLimitBytes: 32768
341344
- activeState:
@@ -426,6 +429,7 @@ xds:
426429
- name: envoy.filters.listener.tls_inspector
427430
typedConfig:
428431
'@type': type.googleapis.com/envoy.extensions.filters.listener.tls_inspector.v3.TlsInspector
432+
maxConnectionsToAcceptPerSocketEvent: 1
429433
name: default/eg/tls-passthrough
430434
perConnectionBufferLimitBytes: 32768
431435
- activeState:

internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -661,6 +661,7 @@
661661
],
662662
"name": "envoy-gateway-system/eg/http"
663663
},
664+
"maxConnectionsToAcceptPerSocketEvent": 1,
664665
"name": "envoy-gateway-system/eg/http",
665666
"perConnectionBufferLimitBytes": 32768
666667
}

internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.all.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ xds:
401401
statPrefix: http-10080
402402
useRemoteAddress: true
403403
name: envoy-gateway-system/eg/http
404+
maxConnectionsToAcceptPerSocketEvent: 1
404405
name: envoy-gateway-system/eg/http
405406
perConnectionBufferLimitBytes: 32768
406407
- '@type': type.googleapis.com/envoy.admin.v3.RoutesConfigDump

internal/cmd/egctl/testdata/translate/out/jwt-single-route-single-match-to-xds.listener.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,5 +162,6 @@ xds:
162162
statPrefix: http-10080
163163
useRemoteAddress: true
164164
name: envoy-gateway-system/eg/http
165+
maxConnectionsToAcceptPerSocketEvent: 1
165166
name: envoy-gateway-system/eg/http
166167
perConnectionBufferLimitBytes: 32768

0 commit comments

Comments
 (0)