Development

TheNeedForSpeed

You must first sign up to be able to contribute.

Version 9 (modified by Michael.Nolan, 11 years ago)
--

The Need For Speed!

As our symfony applications become ever more popular and rise to the heights of success, our databases will suck more air, our server processes will be put into high gear, and our disks will spin at higher RPMs. Like a car stressed and slowed while traveling at high altitude, we begin to feel The Need For Speed.

This wiki entry serves as a central place for people to share tips and techniques for speeding up their symfony web site. This page is not limited to symfony itself and covers all layers of an application from the client's initial request to the final rendering of their page. This includes, but is not limited to, database and web server optimizations, file storage and distribution, caching, load balancing, benchmarking, and so on...

If you have a great tip or technique to improve the speed of our symfony web sites please contribute it here! Please focus on "free" and/or "open source" solutions unless there really is a better alternative.

Symfony Specific Tuning

Caching

Symfony's caching capabilities are covered in the caching chapter of the Definitive Guide to symfony. There is also a chapter about improving performance.

PHP

Configuration (php.ini)

  • realpath_cache_size=64K
  • realpath_cache_ttl=180
  • output_handler = ob_gzhandler compress your php output for browsers that support it. Most useful for modem users.

Code precompilation

  • APC is a free, open, and robust framework for caching and optimizing PHP intermediate code.
  • eAccelerator "is a free open-source PHP accelerator, optimizer, and dynamic content cache. It increases the performance of PHP scripts by caching them in their compiled state, so that the overhead of compiling is almost completely eliminated. It also optimizes scripts to speed up their execution. eAccelerator typically reduces server load and increases the speed of your PHP code by 1-10 times."

Database Optimizations

Indexes

Replication

Query Caching

ORM Layer

Propel

Doctrine

Promised to be faster than Propel, we are eagerly awaiting a 1.0 release of Doctrine. An symfony plugin, sfDoctrinePlugin, is available.

Load Balancing

Load Balancers

  • Perlbal - Free and open source. Used in production on several popular sites.

File Storage and Distribution

Storage Solutions

  • MogileFS - Free and open source. Used in production on several popular sites. Negates the need for RAID. MogileFS is an anagram for "OMG Files". Used in conjunction with Perlbal. You can expect a symfony plugin for MogileFS in the near future.

Page Rendering

Cached Pages

Compression

Tidy

Benchmarking

Tools

Books