Windows 7 PHP + Symfony2 Terribly Slow

Windows 7 php + Symfony2 terribly slow

I had a similar problem with symfony 1 for a time on XP and Server 2003. The solution was to install a PHP accelerator (eAccelerator for us, APC might be a better bet these days) plus FastCGI/fcgid.

Addendum: it's been ages since I've used Apache on Windows. I have generally been of the view that its performance has been getting steadily better, rather than worse; however as with most unusual set-ups, good results are not guaranteed. As per my earlier comment, I recommend asking your question at Apache Lounge, where I previously have received some great expert advice.

If memory serves correctly, they can offer you a free Apache binary compiled with better tools than the standard one offered on the Apache website.

Symfony terribly slow : 30 seconds

Most probably it's because of enabled XDebug.
It happens with many PHP applications on Windows, not only with Symfony.

As discussed here, try to disable "remote_autostart" and "profiler_enable" modes:

xdebug.remote_autostart = 0
xdebug.profiler_enable = 0

Or even comment out line where XDebug is enabled, if above does not help:

;zend_extension = "/absolute/path/to/your/xdebug-extension.so"

Symfony on Xampp is very slow in development, what can I do?

A few quick suggestions:

  • install PHP 5.5.x (faster)
  • Use mod_fcgid instead of mod_php with Apache
  • Raise realpath_cache_size and realpath_cache_ttl in your php.ini
  • disable XDebug
  • ...

See this question, this question and this question.

Symfony2: Slow page loads

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"

Symfony2 Slow Initialization Time

I figured out the cause of the problem (and its not Symfony2). For some reason on the ubuntu VM, the modification times on certain files are incorrect (ie in the future, etc). When symfony2 checks these times using filemtime() against its registry, it determines that the cache is not longer fresh and it rebuilds the whole thing. I haven't been able to figure out why it is doing that yet.

Slow execution of Symfony project locally

Basing on comments under question, we came to the answer that the main reason is XDebug which usually has significant impact on PHP performance.

You wrote in your command that Symfony's profiler now shows 3-6 seconds, but in practice it takes a lot more. That means, that PHP itself is probably not the only problem.

I would suggest to look into browser's developer tools (Firebug etc, depending on the browser you use) and check timeline in Network tab. Maybe it will give you further information where to look for the reason.

For my local computer it usually takes PHP about a second (on dev env; and depending on cache state and what page is it) to execute Symfony.

Symfony2 application very slow in VirtualBox

Use nfs file sharing. Samba and the vbox file share can be very slow.

Your profiling indicates that file system operations are the bottleneck.

Read this blog post http://clock.co.uk/tech-blogs/virtualbox-404-shared-folder-update for more insight



Related Topics



Leave a reply



Submit