douzong5835 2016-08-19 14:40 采纳率: 100%
浏览 129
已采纳

php-fpm访问日志请求时间和xdebug时间不匹配

php-fpm access log request time and xdebug timings doesn't match.

Why does xdebug profiling shows 100ms for request and php-fpm access log showing 700ms+ 7x or even more difference?

Is xdebug missing/skipping something on the way or does fpm is doing something between actual php processing?

Xdebug logging autoload/includes/require timings as well? Database connections etc?

Is there a way to look deeper into the timings that php-fpm is logging into access.log?

  • 写回答

1条回答 默认 最新

  • dongrui6787 2016-08-19 14:49
    关注

    I would suspect that php-fpm logs the time required to setup/teardown the actual php file loadup and cleanout at the end of processing. Xdebug can only become 'self aware' after the call setup, and fawns out when php-fpm starts to cleanup after the php execution completes. I think. I observe the same without php-fpm (from the extended apache logs).

    from apache :

     192.168.1.54 - - [19/Aug/2016:10:35:17 -0400] "POST /idm/feed/do.php HTTP/1.1" 200 2186 0/128868 I:252 O:2434
    

    from the php process :

    2016-08-19T10:35:17-04:00 -api.idm.feed.Servlet          DEBUG /idm/feed[detail] processed in 12.8 ms. , 3 MB
    

    same call ! Apache 128 ms, php 12.8 ms.

    If you are using apache, load the extra modules and use this log format to have the end-to-end time and IO as above :

    load :

    LoadModule log_config_module libexec/mod_log_config.so
    

    log format :

    LogFormat "%h %l %u %t \"%r\" %>s %b %T/%D I:%I O:%O"  common
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 做个有关计算的小程序
  • ¥15 MPI读取tif文件无法正常给各进程分配路径
  • ¥15 如何用MATLAB实现以下三个公式(有相互嵌套)
  • ¥30 关于#算法#的问题:运用EViews第九版本进行一系列计量经济学的时间数列数据回归分析预测问题 求各位帮我解答一下
  • ¥15 setInterval 页面闪烁,怎么解决
  • ¥15 如何让企业微信机器人实现消息汇总整合
  • ¥50 关于#ui#的问题:做yolov8的ui界面出现的问题
  • ¥15 如何用Python爬取各高校教师公开的教育和工作经历
  • ¥15 TLE9879QXA40 电机驱动
  • ¥20 对于工程问题的非线性数学模型进行线性化