Apache Internal Memory algorithm

Source: Internet
Author: User
Apache Memory algorithm
Ask for an Apache memory algorithm
For example, set in php.ini:

Memory_limit = 512M//MAX memory
Memory = 16M//single page Max RAM


Now, for example, there is a a.php

 
 Include (b.php);//or require (b.php);  b.php as an empty page
Echo (Memory_get_usage (TRUE)/1024). ' KB ';
?>


Print out 784KB. So is Apache really only consuming 784KB of memory?
But in fact, PS-AUXF | Sort-nr-k 4 | head-10 a php file really only consumes 784KB in Linux? (The value returned is far greater than 784, is not memory = 16M, a single httpd will need to consume 16MB?)

Also, does the include or require a file, relative to the consumption of 2 httpd processes?


------Solution--------------------
Yes!
Apache (or other Web server) just responds to HTTP requests, starts and waits for PHP to complete
The memory consumption of Apache is related to the number of concurrent response HTTP requests

  • 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.