Share » Learn » eZ Publish » Clustering eZ Publish

Clustering eZ Publish

Tuesday 12 April 2005 7:44:00 am

  • Currently 3 out of 5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

To make eZ Publish run well in a cluster we need to ensure that all data is properly synchronized between the servers. In eZ Publish, most data is stored in the database, however some data is also stored on the filesystem. Data stored on the filesystem includes binary files, images, compiled templates and cache files.

Important data like files and images are synchronized via rsync when changed. Cache files and easily re-generated files are deleted from the other server when it changes. To make this work we patched PHP to automatically log every file created or modified.

To make ez.no sync files between the nodes in the cluster we have made some patches to PHP and eZ Publish that automatically log any new, modified or removed files. Since eZ Publish is using Imagemagick to scale and convert images there are also patches to apply to eZ Publish in order to log the changes to images. The log file created by this patch is then parsed and used by rsync to synchronize the servers.

The script used to rsync the changed files from one server to another is available together with the patches. If you want more servers in this cluster setup then you need to alter the rsync script to sync the files to all other servers in the setup instead of just one. Currently this script is written with a master / slave setup in mind.

This cluster setup is not ideal. If a page is visited on server A which causes an image variation to be created, e.g. the first time an article is shown with an embedded image, and server B gets a hit on the same page before the image variation has been synced from server A to B then the image shown on server B will be broken. The reason for this is that the image is not found on server B at time the page is rendered and hence the cached version of the page will be wrong. The fix for this problem is simply to clear the cache for the page which has the problem image, or to re-publish the object. This problem will be solved for eZ Publish in the future.

In order to make the MySQL server run a bit faster we have have enabled the MySQL query cache and created a larger key buffer. The configuration for this is:

36 542 Users on board!

Tutorial menu

Printable

Printer Friendly version of the full article on one page with plain styles

Author(s)