When I tried to SSH into the server, I got this warning: I can make an SSH connection, but it feels bad ...
Unable to create temporary file for here document:There is no free space on the device
It seems that there is no free space, so when I checked it with the df command, it was as follows. The usage rate is 100%.
df -h
File system size used Remaining used%Mount position
/dev/mapper/centos-root 14G 14G 36K 100% /
I hypothesized that the log file was ridiculously sized, probably because I sent a lot of requests in the load test. When I checked the log file, the size is 9GB or more.
-rw-rw-r--1 hoge hoge 8403185664 January 8 01:09 production.log
-rw-rw-r--1 hoge hoge 991581155 January 8 01:58 unicorn.stderr.log
I copied/dev/null to the log file and emptied the contents of the log file. Now that the warning is gone, it's resolved!
cp /dev/null production.log
-rw-rw-r--1 hoge hoge 0 January 8 09:25 production.log
-rw-rw-r--1 hoge hoge 0 January 8 09:26 unicorn.stderr.log
When I checked "Unable to create temporary file for here document: There is no free space on the device", it seems that there are some events that cannot be deployed or compiled. The behavior of the server itself seems to be strange, so some measures are required in advance. (In this case, write a script that automatically deletes old logs, or set the OS or application server to automatically delete logs ...)
Recommended Posts