1 Databases load balancing
If the load on your Gentics Portal.Node PHP database is too high, you can create additional databases on separate servers to reduce load.
Gentics Portal.Node PHP supports master slave balancing
This allows you to separate read and write operations to different servers.
- Master server – is server which can get read and write operations
- Slave server – is server which can get only read operations
If your database supports data replication, then you can use this option.
Master replicates all his data to the slaves as shown on the diagram:
This is a configuration for database connection component
'components'=> array( ... 'db' => array( 'connectionString' => 'mysql:host=localhost;dbname=gportal', 'username' => 'root', 'password' => 'rootpw', 'charset' => 'utf8', 'slaves' => array( array( 'connectionString' => 'mysql:host=128.2.2.1;dbname=gportal', 'username' => 'root1', 'password' => 'rootpw1', ), array( 'connectionString' => 'mysql:host=128.2.2.5;dbname=gportal', 'username' => 'root2', 'password' => 'rootpw2', ), ), ), )
db array contains master server configuration. slaves array contains slaves servers configuration.
slaves inherits configuration from the main connection configuration.
In the above example each slave setting overwrites parameters connectionString, username, password but charset is used from main connection.
1.1 Load balancing with Gentics Content Connector
Right now there is no defined solution for balancing the requests of the portal from Gentics Content Connector. But this will follow.
2 Servers load balancing
The load balancing between the servers can be done by hardware solution / third party software (like Varnish).
2.1 Varnish
Varnish Cache is a web application accelerator also known as a caching HTTP reverse proxy. You can install it in front of any server that speaks HTTP and configure it to cache and load balance the contents. Varnish Cache is really, really fast. It typically speeds up delivery with a factor of 300 – 1000x, depending on your architecture.
2.2 Repcached
repcached is a patch which adds data replication feature to memcached 1.2.×.
Key features:
- multi master replication.
- asynchronous data repliacation.
- support all memcached command (set, add, delete, incr/decr, flush_all, cas)