I have a rather large and slow (complex data, complex frontend) web application build in
RoR and served by
nginx as reverse proxy.
Looking at the
nginx error log, I see quite a few entries like:
2014/04/08 09:46:08 [warn] 20058#0: *819237 an upstream response is buffered to a temporary file /var/lib/nginx/proxy/8/47/0000038478 while reading upstream, client: 22.214.171.124, server: engagement-console.foo.it, request: "GET /elements/pending?customer_id=2&page=2 HTTP/1.0", upstream: "http://unix:///home/deployer/apps/conversationflow/shared/sockets/puma.sock:/elements/pending?customer_id=2&page=2", host: "ec.reputationmonitor.it", referrer: "http://ec.foo.it/elements/pending?customer_id=2&page=3"
I am rather curious as it's very unlikely that the page remains the same for different users and different user interactions, and I would not think that buffering the response on disk is necessary/useful.
I know about
proxy_max_temp_file_size and setting it to 0, but it seems to me a little bit awkward (my proxy tries to buffer but has no file where to buffer to... how can that be faster?).
My questions are:
How can I remove the [warn] and avoid buffering responses? Is it better to turn off
proxy_bufferingor to set
proxy_max_temp_file_sizeto 0? Why?
nginxbuffers a response: When does it serve the buffered response, to whom, and why?
proxy_bufferingon by default and then [warn]s you if it actually buffers a response?
When does a response trigger that option? When it takes > some seconds (how many?) to serve the response? Is this configurable?