PHP Slow Log

Source: Internet
Author: User
Tags fpm

This article mainly describes the Nginx php-fpm to enable slow log configuration, php-fpm slow log slowlog settings can let us very well see which PHP process is too slow to cause the site problems, can let us conveniently find the problem, the need for friends can refer to the following:

Many webmasters turn to NGINX+PHP-FPM, suffering from 500,502 of problems. When Nginx receives the above error code, it can be determined that the backend php-fpm parsing php out of some kind of problem, such as execution error, execution timeout.

One of the parameters in the php-fpm.conf configuration file is described in Request_slowlog_timeout:

When Request_slowlog_timeout is set to a specific second, Request_slowlog_timeout = 5, indicating which script execution time is greater than 5 seconds, the script is logged to the slow log file

Request_slowlog_timeout =0 indicates that slow log output is turned off.

The slow log file location defaults to the log folder in the PHP installation directory and can be specified by modifying the Slowlog = log/$pool. Log.slow parameter.

PHP-FPM Slow Log example, the slow log will record the process number, the script name, which file which line of code which function execution time is too long.

Code:

Vi/usr/local/php/etc/php-fpm.conf

Request_slowlog_timeout =5

Slowlog = log/$pool. Log.slow

The log is guaranteed to exist:/usr/locla/php/logs below

PHP Slow Log

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.