Slow upload speed when when request buffering is off on a kubernetes nginx ingress

I have a Nginx Ingress in Kubernetes that serves large requests (up to 500MB) from the public internet.

When I disable request buffering nginx.ingress.kubernetes.io/proxy-request-buffering: "off" the request slows down by magnitudes.

To test that it is not caused by something else, I put a simple netcat listener behind the ingress.

  • With request buffering enabled I could upload a 300MB file in 2-3 seconds and I could immediately see the full file dumped by netcat on the netcat pod.
  • With request buffering disabled it takes about 2 minutes and I can see the netcat dump slowly, linearly growing.

Could you help me to understand why the request is choked with buffering off, and whether there’s a way to speed things up while keeping request buffering disabled?

Read more here: Source link