V
V
Valery2013-05-16 19:37:41
symfony
Valery, 2013-05-16 19:37:41

What is the page generation time for a simple site on Symfony2?

I understand that the question is about a horse in a vacuum, so let's fill the vacuum a little:
Let's say there is a main page of the blog.
It displays the last 10 posts (picture + announcement), a menu from the database.
As a server - VDS at 800Mhz (almost the simplest)
Symphony production mode with settings from the documentation.
A set of non-standard bundles:

new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),<br>
new FOS\RestBundle\FOSRestBundle(),<br>
new FOS\UserBundle\FOSUserBundle(),<br>
new JMS\SerializerBundle\JMSSerializerBundle(),<br>

The server has APC - caches through it.
As an ORM - Doctrine
The page is generated in an average time of 400ms (0.4 seconds), while eating as much as 23MB of memory.
Is this time and memory consumption normal? It's hooked up like this:
$t1 = microtime(true);<br>
.....<br>
echo '<!-- '.(microtime(true) - $t1).' -->';<br>

I'm just starting to move away from my bike towards the convenience of the frameworks, and I'm used to it. that my pages are generated exactly 10 times faster and eat about 5Mb on the same hardware (it lies nearby). It became somehow ... uncomfortable from such requests

Answer the question

In order to leave comments, you need to log in

8 answer(s)
N
Nikita Gusakov, 2013-05-16
@hell0w0rd

I think it's FOS, but I could be wrong. I myself experiment with symphony and putting admin panels with FOS on board - the work slows down a lot. In general, symphony has a web profiler in the standard package, it will tell you a lot.
For example, it will reflect all requests + build a beautiful graph from the logs

B
batment, 2013-05-16
@batment

What is more valuable to you: technology, the number of which on the planet tends to infinity, or your time, which is very limited?

A
Assorium, 2013-05-17
@Assorium

In general, there is xDebug and you can easily find out which module is the most

K
kirksa, 2013-05-17
@kirksa

If you are using composer, try it composer dump-autoload -oto speed up autoloading.

K
karser, 2013-05-20
@karser

It eats too much memory, For a blog no more than 5-10 mb. Most likely app_dev.php is used.
Do you have cache enabled? Are you using app.php front controller (env=prod, debug=false, AppCache instead of AppKernel)?

F
faost, 2013-05-22
@faost

See the Performance section in the documentation. For me, for example, autoloader caching in APC hung performance by almost 20%.
Well, if you have a lot of content for unauthorized users, install varnish and everything will fly.

A
Alexey Sundukov, 2013-05-17
@alekciy

Projects are more likely to run into browser DOM rendering speed than during page generation. 0.4 sec is of course long, but quite acceptable. This is an acceptable fee for the ready-made functionality of the framework.
If there are no special requirements for hardware and load stability of the application, then you should use it without hesitation.

A
Alexander, 2014-06-27
@neokortex

I have approximately the same numbers without caching individual controllers. I use doctrine cache

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question