Home  >  Article  >  Backend Development  >  What should I do if the php fpm process is not released?

What should I do if the php fpm process is not released?

藏色散人
藏色散人Original
2021-06-15 10:15:042550browse

The solution to the problem that the php fpm process is not released: 1. Reduce the memory usage of php-fpm by reducing the total number of php-fpm processes; 2. Reduce the number of "pm.max_requests".

What should I do if the php fpm process is not released?

The operating environment of this article: linux5.9.8 system, PHP7.1 version, DELL G3 computer

#php fpm process is not released. manage?

Solving the problem that the php-fpm process does not release memory

By reducing the total number of php-fpm processes to reduce the memory usage of php-fpm, actual use During the process, it was discovered that the php-fpm process still had the problem of occupying memory for a long time without releasing it. The solution is to reduce the number of pm.max_requests.

Maximum number of requests max_requests, that is, when the number of requests processed by a PHP-CGI process accumulates to max_requests, the process will be automatically restarted, thus achieving 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

When the php-fpm process reaches the value set by pm.max_requests, it will Restart the process, thereby freeing up memory. The picture below is the result after my test. It can be seen that the php-fpm process was forcibly terminated and the memory was released.

What should I do if the php fpm process is not released?

Recommended study: "PHP Video Tutorial"

The above is the detailed content of What should I do if the php fpm process is not released?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:What does php dump mean?Next article:What does php dump mean?