How can I use Symfony across multiple servers? I have a high-load project and I want to move parts of it(for example: image handlers, video handlers, registration) to other servers.

  • 1
    Google for "CDN" and "Load balance"
    – TiuTalk
    Nov 16, 2011 at 6:40

3 Answers 3


First of all you can move your database on another machine, then modify your database.yml to connect to the new db.

Second: if you're experiencing a lot of connections you can serve all static contents (images, videos, css...) from another machine (i.e. static.yourdomain.com) that reads data from an nfs shared with the application server. Then modify your templates to refer to the static source (create a key in app.yml as static_site_url and use that so if you need to change in the future it will be simple).

Third: if you're caching on disk take a look to sfMemcacheCache for the view_cache config. Caching in memory is far so quicker than on disk.

Fourth: if you really have a lot of users think to deploy your application on more servers. Yes you will need to manage sessions with a persistent balancer (non need to change your app) or going with sessions on database or going with cookie sessions sfCookieSessionStoragePlugin.


First you can get your database(s) on external servers by modifying the database.yml configuration.

Then you could develop several application, each one dedicated to a task (for instance handling medias), deploy each application on a different server and use them through web service or redirection.

Here's a link about symfony performance optimization.

Other solutions depend more on the infrastructure of your servers than on symfony itself.


As well as the other answers you should take a look at this blog on how to setup session sharing accross multiple server.

I have deployed across multiple servers using a hardware load balancer and all I did was enable session sharing - ensured my database.yml was correct and it worked without any issues ...

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.