Symfony2: Slow page loads

后端 未结 1 1611
再見小時候
再見小時候 2021-02-03 12:37

I am attempting to setup Symfony2 on an Ubuntu virtual host. However even the simple hello world page is taking around 7-8 seconds to load. I have tried running other applicatio

相关标签:
1条回答
  • 2021-02-03 13:03

    Try disabling Xdebug completely.

    I noticed in Symfony 1.3 / 1.4 that my page loads took 40%+ longer to load when Xdebug's profiler was running. I haven't tried Xdebug with Symfony 2.0 yet, but I imagine similar results would ensue.

    The problem is that Symfony is a large framework that does a lot of background processing for you. When Xdebug is profiling this, your pages will take a lot longer to load.

    Your best bet is to download a plugin for your browser that allows you to send the profiler flag to the server only when you need to use it. Xdebug can be setup to profile on request.

    Here are my current Xdebug configurations on my development box:

    xdebug.remote_enable=1
    xdebug.remote_host="127.0.0.1"
    xdebug.remote_port=9000
    xdebug.remote_handler="dbgp"
    xdebug.remote_mode=req
    
    xdebug.profiler_enable = 0
    xdebug.profiler_enable_trigger = 1
    xdebug.profiler_output_dir = "c:\var\profile\"
    xdebug.profiler_output_name = "cachegrind.out.%t"
    
    0 讨论(0)
提交回复
热议问题