Answer the question
In order to leave comments, you need to log in
Why does hello world take 72 seconds to load on symfony?
I decided to choose a framework for the project. I installed yii, tested it, I didn’t like the framework itself a bit, although it works quickly. I decided to test symfony 2. I downloaded the helloWorld assembly from the office. site, installed, opened and ... in 72 seconds I saw the result. Of course, I understand that a netbook with an atom is very slow, but in order to open a page for 72 seconds ... What could be the problem? Or is symfony 2 really so flawed that it generates a response for me for a minute? And in general, I understand that the topic is for a holivar, but in terms of power / performance, who can advise what. I understand that requests to the database usually become the bottleneck anyway, but after looking at the symphony, I somehow immediately lost the desire to use this framework and a certain panic fear of the rest arose. Before that, I worked on zend'e, I knew that it was slow, but it was about 500 ms,
Answer the question
In order to leave comments, you need to log in
Maybe at the first request the cache was generated for a long time?
I also recently decided to try it - I only have this if I reset the cache - the first request is long and then everything is ok.
If you think that this is because of the framework, I feel very sorry for you. max_execution_time 30 sec by default
In the general case, 72s is similar to the situation when the script crawls into the Internet to check for updates (or something else), does not wait for a response (the firewall blocks and / or the site does not respond), the request is reset by timeout and the script continues to work, giving the result.
We do not know specifically for the symphony, but this situation happens with other cmf / cms.
Gentlemen, you have in vain downvoted Meliborn. Maybe he expressed himself arrogantly, but he pointed out your mistake. Let me explain in more detail: in php.ini, by default, the maximum script execution time is 30 seconds. That is, if Symphony did not give a response within 30 seconds, then the script would be interrupted, and you would see an error, instead of "Hello World!". This means that the problem is not in the framework, but in the browser, OS or something else, there can already be a lot of options here, and it’s hard to say without seeing your computer.
If you are using the latest version (which is 2.1.0-DEV) look in the sf2 profiler to see what the page generation time is. A fairly detailed Timeline is made there.
Maybe at the first request the cache was generated for a long time?
I also recently decided to try it - I only have this if I reset the cache - the first request is long and then everything is ok.
I understand. what are you downvoting again now, but just tell me please, why are you downvoting? For the fact that people give answers to questions?
Just introduce yourself in a comment and explain. why you minus - I promise, I won’t give a damn about karma.
Also, I forgot:
Make the Symfony/app/cache and /Symfony/app/logs folders writable if you're running under nyx.
For a fundamental "debriefing" I propose to post your "hello world" application on github. I will try to help.
There are really a lot of useful goodies in symfony2 that eat up resources, especially when flushing the cache. Take at least annotations. In general, quite a lot is parsed, so warmup is a rather long procedure. Moreover, the caches, of course, are separate for each environment. That is, if work is going on simultaneously with dev and prod, both must be reset in the console (I do this in parallel for all env at once).
As for the system, in addition to the slowness of Windows, there are a lot of brakes that stick to PHP - XDebug, xhprof, etc. For me, for example, XDebug slows down tests by 10 times when collecting code coverage metrics.
But in general, a rather smart framework, not the fastest, but the architectural ideas in it are laid down for the future, I think.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question