Home  >  Article  >  Backend Development  >  How to set the number of php processes

How to set the number of php processes

王林
王林Original
2020-05-10 15:46:264675browse

How to set the number of php processes

Just add the following configuration to the php-fpm.conf configuration file:

pm.max_children = 100    #,子进程最大数
pm.start_servers = 30    #,启动时的进程数
pm.min_spare_servers = 20    #,保证空闲进程数最小值,如果空闲进程小于此值,则创建新的子进程
pm.max_spare_servers = 100    #,保证空闲进程数最大值,如果空闲进程大于此值,此进行清理
pm.max_requests = 500    #设置每个子进程重生之前服务的请求数. 对于可能存在内存泄漏的第三方模块来说是非常有用的. 如果设置为 ’0′ 则一直接受请求. 等同于 PHP_FCGI_MAX_REQUESTS 环境变量. 默认值: 0.

Please pay attention to php Chinese website for more related tutorials.

The above is the detailed content of How to set the number of php processes. 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 is mvcNext article:what is mvc