nginx – client request body is buffered to a temporary file

This is a warning, not an error. That’s why it was prefaced with [warn] in the log.

It means that the size of the uploaded file was larger than the in-memory buffer reserved for uploads.

The directive client_body_buffer_size controls the size of that buffer.

If you can afford to have 1GB of RAM always reserved for the occasional file upload, then that’s fine. It’s a performance optimization to buffer the upload in RAM rather than in a temporary file on disk, though with such large uploads a couple of extra seconds probably doesn’t matter much. If most of your uploads are small, then it’s probably a waste.

In the end, only you can really make the decision as to what the appropriate size is.

Leave a Comment