In my app, I have nginx proxy to my app server (unicorn).
I'm trying to improve my file upload performance. I've read that through various techniques you can prevent your app processes from being blocked while the file is uploading. Current information on the best way to approach this topic seems hard to come by (see this question).
I'm trying to do this using client_body_in_file_only on;
which as I understand it tells nginx to buffer the entire request to disk.
What I'm confused about is that even without this directive I see this in my nginx logs:
2014/10/10 17:41:43 [warn] 50331#0: *798 a client request body is buffered to a temporary file /usr/local/var/run/nginx/client_body_temp/0040665399, client: 127.0.0.1, server: my_site.dev, request: "POST /upload HTTP/1.1", host: "my_site.dev", referrer: "https://my_site.dev/upload"
It looks to me like nginx is buffering the file upload to disk anyway. Is nginx just smart out of the box here? Should I still use client_body_in_file_only
? Am I misunderstanding what's happening here?