@@ -76,12 +76,13 @@ func BuildConfiguration(
7676 buildRefCertificateBundles (g .ReferencedSecrets , g .ReferencedCaCertConfigMaps ),
7777 backendGroups ,
7878 ),
79- Telemetry : buildTelemetry (g , gateway ),
80- BaseHTTPConfig : baseHTTPConfig ,
81- Logging : buildLogging (gateway ),
82- NginxPlus : nginxPlus ,
83- MainSnippets : buildSnippetsForContext (gatewaySnippetsFilters , ngfAPIv1alpha1 .NginxContextMain ),
84- AuxiliarySecrets : buildAuxiliarySecrets (g .PlusSecrets ),
79+ Telemetry : buildTelemetry (g , gateway ),
80+ BaseHTTPConfig : baseHTTPConfig ,
81+ Logging : buildLogging (gateway ),
82+ NginxPlus : nginxPlus ,
83+ MainSnippets : buildSnippetsForContext (gatewaySnippetsFilters , ngfAPIv1alpha1 .NginxContextMain ),
84+ AuxiliarySecrets : buildAuxiliarySecrets (g .PlusSecrets ),
85+ WorkerConnections : buildWorkerConnections (gateway ),
8586 }
8687
8788 return config
@@ -1105,6 +1106,21 @@ func buildLogging(gateway *graph.Gateway) Logging {
11051106 return logSettings
11061107}
11071108
1109+ func buildWorkerConnections (gateway * graph.Gateway ) int32 {
1110+ defaultWorkerConnections := int32 (1024 )
1111+
1112+ if gateway == nil || gateway .EffectiveNginxProxy == nil {
1113+ return defaultWorkerConnections
1114+ }
1115+
1116+ ngfProxy := gateway .EffectiveNginxProxy
1117+ if ngfProxy .WorkerConnections != nil {
1118+ return * ngfProxy .WorkerConnections
1119+ }
1120+
1121+ return defaultWorkerConnections
1122+ }
1123+
11081124func buildAuxiliarySecrets (
11091125 secrets map [types.NamespacedName ][]graph.PlusSecretFile ,
11101126) map [graph.SecretFileType ][]byte {
@@ -1143,8 +1159,9 @@ func buildNginxPlus(gateway *graph.Gateway) NginxPlus {
11431159
11441160func GetDefaultConfiguration (g * graph.Graph , gateway * graph.Gateway ) Configuration {
11451161 return Configuration {
1146- Logging : buildLogging (gateway ),
1147- NginxPlus : NginxPlus {},
1148- AuxiliarySecrets : buildAuxiliarySecrets (g .PlusSecrets ),
1162+ Logging : buildLogging (gateway ),
1163+ NginxPlus : NginxPlus {},
1164+ AuxiliarySecrets : buildAuxiliarySecrets (g .PlusSecrets ),
1165+ WorkerConnections : buildWorkerConnections (gateway ),
11491166 }
11501167}
0 commit comments