The CI framework performs a workaround for excessive memory usage under the CLI _php instance

Source: Internet
Author: User
Many programmers use the CodeIgniter CLI to perform a large-scale data import problem, there will always be high memory situation, the following for this analyzer cause and resolution.

CI DB saves all query SQL and SQL execution time , and for import problems like millions big data, the SQL records they execute are stored in the content, which takes up a lot of content until the end of the script.

Workaround:
When you perform a large number of DB operations, remember to set:
Copy the Code code as follows:
$this->db->save_queries = FALSE;

  • Related Article

    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.