Recently from Google Ananlytics found that the Web site slowed a lot, so think of PHP fpm slow log function.
Fortunately, the PHP-FPM provides a slow execution log, which dumps the call procedure that executes the slower script into the log.
Shell Code
cd/etc/php5/fpm/pool.d/
VI www.conf
Modify Configuration
Java code
; The timeout for serving a i after which a PHP backtrace'll be
; dumped to the ' slowlog ' file. A value of ' 0s ' means ' off '.
Available units:s (econds) (default), M (inutes), H (ours), or D (ays)
; Default value:0
request_slowlog_timeout = 1s
; The log file for slow requests
; Default Value:/usr/local/php/log/php-fpm.log.slow
slowlog =/usr/local/php/log/php-fpm.log.slow
With the slow execution log, we can easily see the problem from the slow execution log, such as:
Log Code
[13-may-2013 05:17:12]
[Pool www] pid 13557
Script_filename =/opt/www/inkebook/index.php [0X000000000292E0F0] Commit ()/opt/www/inkebook/includes/database/ mysql/database.inc:166 [0x000000000292de88] popcom
Mittabletransactions ()/opt/www/inkebook/includes/database/database.inc:1128
[0x000000000292dcf0] Poptransaction ()/opt/www/inkebook/includes/database/database.inc:1905
[0x00007fffe78cc460] __destruct () unknown:0 [0x000000000292c690] Execute ()/opt/www/inkebook/modules/statistics/statistics.module:73
[0x00007fffe78cc900] Statistics_exit () unknown:0 [0x000000000292c208] Call_user_func_array ()/opt/www/inkebook/includes/modu le.inc:857 [0X000000000292BF10] Module_invoke_a
LL ()/opt/www/inkebook/includes/common.inc:2688
[0x000000000292ade0] Drupal_page_footer ()/opt/www/inkebook/includes/common.inc:2676 [0x000000000292aa28] Drupal_deliver_html_page ()/opt/www/inkebook/includes/commo n.inc:2560 [0x000000000292a378] Drupal_deliver_page ( )/opt/www/inkebook/includes/menu.inc:532 [0x000000000292a198] Menu_ Execute_active_handler ()/opt/www/inkebook/index.php:21
Further analysis of the procedure will be more directional.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/webkf/PHP/