# sfPropelLoadbalancerPlugin ## Abstract This plugin implements a simple loadbalancer for Propel with Creole. It is based on the sfDebugConnection class. The loadbalancer is currently meant for replication setups of single master and multiple slaves. Balancing simply chooses one of the available slaves randomly. This plugin requires symfony 1.0.x. Be aware that it doesn't use any database specific queries for example to ensure that slaves are synced. The might lead to problems on high traffic sites. ## Getting started * Install the plugin. Clear the cache. * You have to enable it in app.yml otherwise it will not do anything. all: sfPropelLoadbalancerPlugin: enabled: true * In your databases.yml you have to replace sfPropelDatabase by sfPropelLoadbalancerDatabase * There are two additional parameters that must be configured correctly. Here is a complete example: all: # master server connection (only one is supported) symfony: class: sfPropelLoadbalancerDatabase param: phptype: mysql hostspec: ##host## database: ##database## username: ##user## password: ##password## compat_assoc_lower: true compat_rtrim_string: true is_master: true # you have to set one connection to be the master master_mode: rw # w is mandatory, r also uses master connection for selects # slave server connections (multiple slaves are supported) slave1: class: sfPropelLoadbalancerDatabase param: phptype: mysql hostspec: ##host## database: ##database## username: ##user## password: ##password## compat_assoc_lower: true compat_rtrim_string: true enable_loadbalancer: false # you can exclude a connection from loadbalancing ## Caution This plugin is alpha! Please test it and make backups first before running it in production. There might be open issues that could lead to inconsistent data.