开发者

PHP Guru about script timeouts

Sometimes I get random PHP execution timeouts. Is there a way to troubleshoot where it is 开发者_如何学Pythoncoming from? A way to debug this?

Thanks...


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜