drmq16019 2015-01-18 03:09
浏览 52
已采纳

如何进行PHP程序的堆栈转储

A large third-party PHP application is taking a very long time (multiple seconds) to process a certain POST request. I need to find out what is taking so long.

In the Java land, taking a few thread dumps would often (not always) tell you where the program is stuck. Can I do something similar in PHP?

The debug_backtrace() function would not help in this situation, because I so not have a specific place in the PHP code where I would put debug_backtrace() call. Instead, I want PHP code to start executing, then dump a stack trace approximately 2 seconds into execution.

  • 写回答

1条回答 默认 最新

  • dquh37673 2015-01-18 03:12
    关注

    I would recommend you take a look at xdebug and doing proper profiling: http://www.xdebug.org/docs/profiler

    You'll be able to generate a dump of all method calls in your application, which includes execution time. You can then load and analyse them with KCacheGrind/WinCacheGrind.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog