Thursday, October 2, 2014

inode - Can I delete files in nginx client_body_temp directory?



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?



Answer




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.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...