Yesterday encountered a problem, using the YII framework to write PHP script, more than 1 million db of data export, run, success.
However, when running to No. 490000, the script terminates, prompting the error "File size limit exceeded", so Google, it turns out that a file size exceeds the system limit. The author's first reaction, the log file is full??? Quickly check log, incredibly only dozens of k!!! So where is this "big file"?
Start analysis, it can not be the problem of YII framework, this is the Linux operating system exception problem with the framework is not light, not the size of the log file, carefully review all the settings of the log path under the file, are small can be ignored, even if the Yii debug is switched off, there is the same problem.
Then change the idea, rerun the script, run the script again, found that the time of the dead is very regular, are in 450,000 records when hanging off, a little more a lot, began to doubt the process. Determines the IO that the script process affects.
1, first get the script process ;
2. Use the lsof command to view the IO condition of this PID: lsof-p
Found a suspected file data0/xdebug/cachegrind.out. , with the execution of the script, the size of the Xdebug file also increases, finally, the wish, hang off! At this point the file size is: 2147483647!!
Haha, good familiar with the numbers, 2^31-1!!
It seems that the problem has been found, when the script is executed, xdebug the script process to write a log, when the size of the file than the system can support the size of the file, as scheduled to hang off.
OK, turn off the Xdebug, re-run the script, more than 1 million of the records run smoothly, done.
PS: The server used by the author is a 32-bit system, while in 32-bit operating system, the data that can be stored by the binary is 1111111111111111111111111111111.
Because of this, the decimal in other visual systems is 2147483647.
http://www.bkjia.com/PHPjc/327621.html www.bkjia.com true http://www.bkjia.com/PHPjc/327621.html techarticle yesterday encountered a problem, using the YII framework to write PHP script, more than 1 million db of data export, run, success. However, when running to No. 490000, the script terminates, prompting the error " ...