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