If you are running Symfony on a production system and want to speed it up, you are probably willing to do the following:
1) Enable APC
To enable the ByteCache – System called APC just install it using PECL after you intalled apache2-dev and php5-dev
pecl install apc.
This will cache all your php-files as precompiled versions thus avoiding Apache to start the PHP-Process again and again and reinterpreting the PHP-Code. Take care that you added the “extension = apc.so” line to your php.ini and that you resolve all dependencies for the installed packages.
2. Use fragment caching
If your symfony application is well build, you probably are using lot of components, partials and actions for performing various tasks. If you did this carefully you can enable the Symfony integrated fragment cache for each of this parts defining the lifetime of the cached files. This will help you saving tons of SQL queries and furthermore will provide the Server with plain HTML-code, which is very easy to send to the user. To enable the cache you might go through all your modules, actions and components and define the cache setup for them.
Again, the architecture of your software is very important to profit of fragment caching, eventually your might consider some refactoring, because fragement caching is very very powerfull – you can save up to 90% of your heaviest DB-queries.
If you also think about using Lighttpd - read about it carefully. This server is best for static files. Don’t use it for PHP.
This entry was posted on Friday, September 14th, 2007 at 4:58 pm and is filed under Projects, SQL, Symfony. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.