douzepao0281 2011-04-14 03:28
浏览 7

关于脚本超时的PHP大师

Sometimes I get random PHP execution timeouts. Is there a way to troubleshoot where it is coming from? A way to debug this?

Thanks...

  • 写回答

1条回答 默认 最新

  • duanhao8540 2011-04-14 03:42
    关注

    If you're not sure which part of the code is taking a lot of time, you can grab time stamps before and after each portion of code, compare then for the difference in time, and report those out. This will let you know which pieces of your code take the longest.

    If you have random timeouts, and the script usually processes very quickly, then I would guess it's one of two things (I'm sure there are MANY more scenarios than this):

    1) If you're connecting to an external source that isn't responding, that could cause a timeout 2) You have a dynamic piece of code that can process very little or a lot of information depending on the environment and user (for instance, you allow image uploads, or dynamic sql queries, etc)

    If you have code (even pseudo code) that could describe the situation, it could make it easier for us to see where there may be problems.

    评论

报告相同问题?

悬赏问题

  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
  • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算