Solve the problem that the php-fpm process does not release memory
##By reducing php- The total number of fpm processes can be used to reduce the memory usage of php-fpm. During actual use, it was found that the php-fpm process still has the problem of long-term memory occupation without releasing it. The solution is to reduce the number of pm.max_requests. (Recommended learning: PHP programming from entry to proficiency)
Maximum number of requests max_requests, that is, when the number of requests processed by a PHP-CGI process accumulates to max_requests, it will automatically restart This process achieves the purpose of releasing memory. Take the VPS host setting of 1GB memory as an example (if the value you set does not reach the free memory, you can continue to lower it):pm.max_requests = 500
The above is the detailed content of php process does not release memory. For more information, please follow other related articles on the PHP Chinese website!