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

Support enabling mimalloc and turn it on by default #54

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ and this project's packages adheres to [Semantic Versioning](http://semver.org/s

### Changed

- Support and enable by default [mimalloc](https://github.com/microsoft/mimalloc) as a drop-in malloc replacement to reduce nginx memory utilization.
- Support configuring additional environment variables for NGINX Ingress Controller container to support configuring additional mimalloc [options](https://github.com/microsoft/mimalloc#environment-options).

## [v1.6.8] 2020-04-09

### Changed
Expand Down
2 changes: 2 additions & 0 deletions helm/nginx-ingress-controller-app/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ Parameter | Description | Default
`controller.autoscaling.targetCPUUtilizationPercentage` | Configures HPA target CPU utilization percentage. This is a replacement for deprecated `configmap.hpa-target-cpu-utilization-percentage` configuration property; if both are configured, `configmap.hpa-target-cpu-utilization-percentage` has precedence. | `50`
`controller.autoscaling.targetMemoryUtilizationPercentage` | Configures HPA target memory utilization percentage. This is a replacement for deprecated `configmap.hpa-target-memory-utilization-percentage` configuration property; if both are configured, `configmap.hpa-target-memory-utilization-percentage` has precedence. | `80`
`controller.defaultSSLCertificate` | The Secret referred to by this flag contains the default certificate to be used when accessing the catch-all server. If this flag is not provided NGINX will use a self-signed certificate. Example value: "default/foo-tls". This is a replacement for deprecated `configmap.default-ssl-certificate` configuration property; if both are configured, `configmap.default-ssl-certificate` has precedence. | ""
`controller.enableMimalloc` | Enables mimalloc as a drop-in replacement for malloc, reduces the memory utilization. | `true`
`controller.extraEnvs` | Additional environment variables to set. | `[]`
`controller.ingressController.legacy` | Legacy or node pools cluster. On aws provider node pool clusters LoadBalancer service gets created. Dynamically calculated during cluster creation. | `false`
`controller.ingressClass` | Ingress class, which controller handles. This is a replacement for deprecated `configmap.ingress-class` configuration property; if both are configured, `configmap.ingress-class` has precedence. | `nginx`
`controller.lifecycle` | Configures NGINX controller container lifecycle hooks. | By default configured to run `/wait-shutdown` as controller container preStop hook.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ spec:
valueFrom:
fieldRef:
fieldPath: metadata.namespace
{{- if .Values.controller.enableMimalloc }}
- name: LD_PRELOAD
value: /usr/local/lib/libmimalloc.so
{{- end }}
{{- if .Values.controller.extraEnvs }}
{{- toYaml .Values.controller.extraEnvs | nindent 8 }}
{{- end }}
readinessProbe:
httpGet:
path: /healthz
Expand Down
14 changes: 14 additions & 0 deletions helm/nginx-ingress-controller-app/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,20 @@ controller:
command:
- /wait-shutdown

# Enable mimalloc as a drop-in replacement for malloc.
# For additional options it provides see https://github.com/microsoft/mimalloc#environment-options
# ref: https://github.com/microsoft/mimalloc
enableMimalloc: true

# Additional environment variables to set
extraEnvs: []
# extraEnvs:
# - name: FOO
# valueFrom:
# secretKeyRef:
# key: FOO
# name: secret-resource

# optional hpa settings
autoscaling:
enabled: true
Expand Down