5

On my nginx server, I can't login to my wordpress site. The error log mentions " No space left on device".

2014/09/26 02:02:05 [crit] 1197#0: *32 open() "/usr/local/nginx/client_body_temp/0030999742" failed (28: No space left on device)

There is space but I found that my inode usage was 100%

I have tracked down the ridiculous amount of files to /usr/local/nginx/client_body_temp where there are too many files to count.

So my question is: what is this directory for, and can I delete these files?

Adripants
  • 347
  • 2
  • 5
  • 16
  • Did you turn on `client_body_in_file_only` directive? Maybe those file was caused by that. – masegaloeh Sep 26 '14 at 03:08
  • I didn't turn it on but it's on. Reading up on http://nginx.org/en/docs/http/ngx_http_core_module.html#client_body_in_file_only makes me think it's ok to delete them since it's optional to save them. – Adripants Sep 26 '14 at 03:21

1 Answers1

10

what is this directory (/usr/local/nginx/client_body_temp/) for?

The directory was used to save buffered temporary file from client request body. Normally the temporary file inside the directory was used to buffer request body that larger than client_body_buffer_size. And normally the file was removed after nginx has finished process the request.

Other use of that directory is to debug client request body. When you set client_body_in_file_only on;, nginx will save the body to those directory. But, in this case nginx won't remove them. You can use client_body_in_file_only clean; for clean the temporal files or disable it with client_body_in_file_only off;

and can I delete these files?

Yes, you can safely remove those files.

shakaran
  • 356
  • 1
  • 7
  • 19
masegaloeh
  • 18,236
  • 10
  • 57
  • 106