简体   繁体   English

PHP:Xdebug性能问题

[英]PHP: Xdebug performance issue

Developing a Symfony2 application with Xdebug activated for debugging, I notice a real performance issue. 在激活用于调试的Xdebug的情况下开发Symfony2应用程序时,我注意到一个真正的性能问题。 A page needs about 10s to load (even if the debug cookie isn't sent), disabling xdebug extension it only takes 2s ! 一个页面需要大约10秒钟来加载(即使未发送调试Cookie),禁用xdebug扩展也只需2秒钟!

My configuration is: 我的配置是:

xdebug.remote_enable=on
xdebug.remote_handler=dbgp
xdebug.remote_host=localhost
xdebug.remote_port=9000
xdebug.profiler_enable_trigger=off
xdebug.trace_enable_trigger=0
xdebug.profiler_enable=0

xdebug.auto_trace=0
xdebug.trace_format=2

xdebug.trace_output_dir="C:/Inetpub/logs/PHP/profiles"
xdebug.trace_output_name="cachegrind.out.trace.%R.%p"
xdebug.remote_mode=req

xdebug.profiler_output_dir="C:/Inetpub/logs/PHP/profiles"
xdebug.profiler_output_name="cachegrind.out.profile.%t-%s"
xdebug.profiler_append=1

xdebug.max_nesting_level=250

Any idea? 任何想法?

This is totally normal. 这是完全正常的。 Xdebug has huge performance impact (event if you are not debugging currently). Xdebug会对性能产生巨大影响(如果您当前未在调试,则为事件)。 This is one of reasons that you should not install this extension on production environments. 这是您不应该在生产环境上安装此扩展程序的原因之一。

Check these blog entries to get more info: 检查这些博客条目以获取更多信息:

  1. PHP's XDebug tracing overhead in production PHP的XDebug跟踪生产中的开销

  2. Careful: XDebug can skew your performance numbers 小心:XDebug可能会扭曲您的性能数字

and this stackoverflow question 和这个stackoverflow问题

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM