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

I'd like to configure the Nginx Ingress Controller to buffer upload file content into a temporary file instead of storing it in memory #11352

Open
Sravan9888 opened this issue May 9, 2024 · 1 comment
Labels
needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.

Comments

@Sravan9888
Copy link

Sravan9888 commented May 9, 2024

I'd like to configure the Nginx Ingress Controller to optimize the handling of file upload requests by buffering them into temporary files instead of utilizing memory. Specifically when modsecurity(WAF) is enabled, I encountered an issue where uploading 2GB text files resulted in the controller pod consuming 2GB of memory. Upon inspection, I noticed that the client request body buffer was being stored in the temporary directory "/tmp/nginx/client-body/". To address this, I aim to minimize memory usage by buffering requests into temporary files and disable the response buffer. Below is the configuration I utilized with Helm chart values:

controller:
       config:
          use-proxy-protocol: "true"
          enable-modsecurity: "true"
          enable-owasp-modsecurity-crs: "true"
          client-body-buffer-size: "8k"  # Set the buffer size for reading client request bodies
          client-max-body-size: "100m"     # Limit the maximum size of the client request body
          proxy-response-buffering: "off"

Spec:
nginx version: nginx/1.19.10
k8s server version: v1.23.17
helm version: v3.13.2
Ingress controller helm chart version: 3.39.0

I appreciate any guidance or suggestions on how to optimize this configuration further.

@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If Ingress contributors determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority labels May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs-kind Indicates a PR lacks a `kind/foo` label and requires one. needs-priority needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
Development

No branches or pull requests

2 participants