Ubuntu PHP is a resource-intensive solution

Source: Internet
Author: User
Ubuntu PHP takes up a lot of resources

------to solve the idea----------------------
This is the case in itself, so when using PHP, you should pay attention to the problem of process occupancy.
------to solve the idea----------------------
You're a Windows obsessive syndrome, it's okay, because the kernel mechanism of Linux, these cache content can increase the file and read and write speed. When your server request is idle, the system automatically handles the
------to solve the idea----------------------
Nginx and PHP-FPM configuration remember to adjust well

Pm.max_children: The number of PHP-FPM processes that are open in static mode.
Pm.start_servers: The number of start PHP-FPM processes under dynamic mode.
Pm.min_spare_servers: The minimum number of PHP-FPM processes under dynamic mode.
Pm.max_spare_servers: The maximum number of PHP-FPM processes under dynamic mode.

Memory_limit: The amount of memory a process consumes

PHP-FPM maximum number of processes = (your total memory-memory required for system operation (approximately 200M) * 70% (reserved 30%))/Memory_limit
------to solve the idea----------------------
There is a logic problem in the code, whether the loop is using a large array is not released.
  • 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.