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

Added max-conns annotation #614

Merged
merged 4 commits into from
Jul 8, 2019
Merged

Added max-conns annotation #614

merged 4 commits into from
Jul 8, 2019

Conversation

vrrs
Copy link
Contributor

@vrrs vrrs commented Jul 3, 2019

Proposed changes

These changes enable the annotation max-conns which set the parameter max_conns on upstream server in nginx config. For instance,
nginx.org/max-conns: 6 on ingress.yaml should add to ngnix config

upstream myService-ingress-prod-myService.production.ingress.net-myService-prod-80 {
   server 125.255.255.255:8888 max_fails=3 fail_timeout=10 max_conns=6;
}

Here it's the documentation for max_conn https://nginx.org/en/docs/http/ngx_http_upstream_module.html

max_conns=number
limits the maximum number of simultaneous active connections to the proxied server (1.11.5). Default value is zero, meaning there is no limit. If the server group does not reside in the shared memory, the limitation works per each worker process.

Use case

This parameter is very useful on load balancing long lived connections and limiting load on the destination servers.

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto master
  • I will ensure my PR is targeting the master branch and pulling from my branch from my own fork

@Dean-Coakley Dean-Coakley added the enhancement Pull requests for new features/feature enhancements label Jul 4, 2019
Copy link
Contributor

@Dean-Coakley Dean-Coakley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @vrrs

Thanks a lot for taking the time to write this PR!

Just a few small changes required and we'll get this merged shortly!

internal/configs/annotations.go Outdated Show resolved Hide resolved
@vrrs
Copy link
Contributor Author

vrrs commented Jul 4, 2019

@Dean-Coakley Made the changes suggested.

Copy link
Contributor

@Dean-Coakley Dean-Coakley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Lgtm once: #614 (comment) is applied

Lgtm

Copy link
Contributor

@pleshakov pleshakov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vrrs looks good! ty
just a small doc problem left.

@@ -164,6 +164,7 @@ spec:
| `nginx.org/grpc-services` | N/A | Enables gRPC for services. Note: requires HTTP/2 (see `http2` ConfigMap key); only works for Ingresses with TLS termination enabled. | N/A | [GRPC Services Support](../examples/grpc-services).|
| `nginx.org/websocket-services` | N/A | Enables WebSocket for services. | N/A | [WebSocket support](../examples/websocket). |
| `nginx.org/max-fails` | `max-fails` | Sets the value of the [max_fails](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#max_fails) parameter of the `server` directive. | `1` | |
| `nginx.org/max-conns` | `max-conns` | Sets the value of the [max_conns](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#max_conns) parameter of the `server` directive. | `0` | |
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small doc problem, the max-conns ConfigMap is not supported, so it has to be removed from the doc:

Suggested change
| `nginx.org/max-conns` | `max-conns` | Sets the value of the [max_conns](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#max_conns) parameter of the `server` directive. | `0` | |
| `nginx.org/max-conns` | N/A | Sets the value of the [max_conns](https://nginx.org/en/docs/http/ngx_http_upstream_module.html#max_conns) parameter of the `server` directive. | `0` | |

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@pleshakov done

@Dean-Coakley Dean-Coakley merged commit f87aacb into nginxinc:master Jul 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Pull requests for new features/feature enhancements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants