Home > Backend Development > PHP Tutorial > PHP-FPM enables slow logging method

PHP-FPM enables slow logging method

little bottle
Release: 2023-04-06 08:38:01
forward
3894 people have browsed it

The main content of this article is about using PHP-FPM to enable slow logging. It has certain learning value. Interested friends can learn about it.

fpm: FastCGI Process Manager is an alternative PHP FastCGI implementation that is useful for sites with heavy loads.
1. Advanced process control, graceful stop and start
2. Able to use different uid/gid/chroot/environment to start workers, use different php.ini, and listen to different ports
3.stdout stderr logging
4.Emergency restart in case of opcode cache damage
5.Accelerated upload support
6.slowlog slow logging script, which can record PHP tracking and remote process execute_data, ptrace or similar tools to read Fetching and analysis
7.fastcgi_finish_request() refreshes all data. When doing time-consuming operations, such as video conversion and statistical processing, after fastcgi_finish_request(), the script will still occupy the FPM process. Therefore, overusing it for long-running tasks may occupy all FPM threads until pm.max_children
8. Dynamic static child process generation
9. Basic SPAI state, based on php.ini configuration file

php-fpm Enable slow query log:

/etc/php/7.0/fpm/pool.d/www.conf 
slowlog = /var/log/php-fpm-$pool.log.slow //日志目录
request_slowlog_timeout = 5  //超时时间
Copy after login

Related tutorials: PHP video tutorial

The above is the detailed content of PHP-FPM enables slow logging method. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:cnblogs.com
Statement of this Website
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
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template