Symfony, performance, and High CPU usage


Server is slowing down, and noticing that your Symfony project is consuming enormous amount of CPU? Try this tweak:

# factories.yml
all:
  routing:
    class: sfPatternRouting
    param:
      cache: null
**What it does:** This config disables the Symfony Routing Cache, which uses PHP serialize/unserialize functions, and can cause lots of CPU processing. In my case, a high server load of ~8 went under 1 with this simple tweak (on a dual core). Easy change, but hard to find in the docs. This was the one most important tweak that reduced my server load, but there are a few others, including: * A variation of the above tweak, by enabling **lazy\_routes\_deserialize** in factories.yml ([doc][1]) * Disable **check_lock** in settings.yml ([doc][2]) * Disable the **Symfony compressor** ([doc][3]) Happy tweaking! [1]: http://www.symfony-project.org/reference/1_2/en/05-Factories [2]: http://www.symfony-project.org/book/1_2/19-Mastering-Symfony-s-Configuration-Files [3]: http://www.symfony-project.org/book/1_2/18-Performance