Yesterday I encountered a problem. I used the Yii framework to write a php script to export and run more than 1 million of the data in the database.
However, when the script is running for 49th million lines, the error "File size limit exceeded" is returned. google prompts that the size of a File exceeds the system limit. The first response is that the log file is full ??? In a hurry to view logs, there are only dozens of K !!! So where is this "big file?
It is impossible to start the analysis because of the Yii framework. This is a linux operating system exception and the framework is not light, nor the log file size. You have carefully checked all the files in the configured log Path, even if the Yii debug is turned off, the same problem occurs.
In another way, we re-run the script and run the script again. We found that the time for dead was quite regular, and all of them were suspended when there were 0.45 million records. There were not many records, and we began to suspect that it was related to the process. Determines the io affected by the script process.
1. Obtain the <pid> of the script process first;
2. Run the lsof command to view the io status of the pid: lsof-p <pid>
We found a suspected file data0/xdebug/cachegrind. out. <pid>. With the execution of the script, the size of this xdebug file also increases. Finally, as expected, it will be suspended! The file size is 2147483647 !!
Haha, a familiar number, 2 ^ 31-1 !!
It seems that the problem has been found. During script execution, xdebug also records the write logs of the script process. When the file size exceeds the size of the files supported by the system, it will be suspended as scheduled.
OK. Turn xdebug off and re-run the script. the more than 1 million records are successfully completed.
Ps: the server used by the author is a 32-bit system. In a 32-bit operating system, the maximum data stored by the server is 1111111111111111111111111111111 because it is binary.
For this reason, the decimal Value embodied in other visual systems is 2147483647.