Temp disk space usage

Andrew Deason zeroguy at verizon.net
Thu Oct 18 00:00:32 MSD 2007

I'm running nginx 0.5.26 on OpenBSD 4.0 as a load-balancing reverse
proxy to two backend web servers. Recently we tried serving several
moderately large static files (around 100-200MB each), and had numerous
concurrent connections downloading them at a time.

When this started, the disk space usage on the machine running nginx
began climbing rapidly, and soon ran out of space. There's only a few
GB that nginx can use; we did not anticipate this server to need a lot
of disk space, as it's not intended to be a caching proxy. Anyway, when
the disk is full, nginx understandably started throwing "writev() failed
(28: No space left on device) while reading upstream" errors, but when
nginx was restarted, everything was fine (and we gained several GB of
space back).

The only nginx.conf directive that we have that has anything to do with
buffering/caching/temp files is `large_client_header_buffers 4 8K;`,
which doesn't have anything to do with this. Everything else related to
buffers and temp files should be set to the default.

Is nginx buffering the entire file from the backend server on disk
while serving it to the client? Are there any options to tune this, or
limit disk usage by temporary files?

Andrew Deason
zeroguy at verizon.net

More information about the nginx mailing list