How to troubleshoot file size limit exceeded errors _php tutorial

Source: Internet
Author: User
Tags yii
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 " ...

  • Contact Us

    The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

    If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.