Merge pull request #3222 from diazjf/add-timeouts-and-such

Allow Ability to Configure Upstream Keepalive
This commit is contained in:
k8s-ci-robot 2018-10-12 06:15:09 -07:00 committed by GitHub
commit 0baf62dd6a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 41 additions and 51 deletions

View file

@ -393,9 +393,17 @@ type Configuration struct {
// upstream servers that are preserved in the cache of each worker process. When this
// number is exceeded, the least recently used connections are closed.
// http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive
// Default: 32
UpstreamKeepaliveConnections int `json:"upstream-keepalive-connections,omitempty"`
// Sets a timeout during which an idle keepalive connection to an upstream server will stay open.
// http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive_timeout
UpstreamKeepaliveTimeout int `json:"upstream-keepalive-timeout,omitempty"`
// Sets the maximum number of requests that can be served through one keepalive connection.
// After the maximum number of requests is made, the connection is closed.
// http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive_requests
UpstreamKeepaliveRequests int `json:"upstream-keepalive-requests,omitempty"`
// Sets the maximum size of the variables hash table.
// http://nginx.org/en/docs/http/ngx_http_map_module.html#variables_hash_max_size
LimitConnZoneVariable string `json:"limit-conn-zone-variable,omitempty"`
@ -651,6 +659,8 @@ func NewDefault() Configuration {
ProxyBuffering: "off",
},
UpstreamKeepaliveConnections: 32,
UpstreamKeepaliveTimeout: 60,
UpstreamKeepaliveRequests: 100,
LimitConnZoneVariable: defaultLimitConnZoneVariable,
BindAddressIpv4: defBindAddress,
BindAddressIpv6: defBindAddress,