Server Clustering

ACS Documentation : ACS Administrator's Guide : Server Clustering

The Problem

Many heavily-hit sites sit behind load balancers, which means that requests to a particular site can be handled by one of several machine conspiring to appear as a single server. For instance, requests to might be routed to either,, or, three physically separate servers which share an Oracle tablespace (and hence all the data in ACS).

Many database queries are memoized in individual servers' local memory (using the util_memoize procedures) to minimize fetches from the database. When a server updates an item in the database, the old item needs to be removed from the server's local cache (using util_memoize_flush) to force a database query the next time this item is accessed. But what happens when:

In general, if any of several servers can update an item, the old version of the item can remain in other servers' local caches. Doh!

The Solution

We introduce the concept of a server cluster, a group of look-alike servers sharing an Oracle tablespace. To set up a cluster, add the following to the ACS parameters/yourservername.ini file on each of the servers in the cluster:
; address information for a cluster of load-balanced servers (to enable
; distributed util_memoize_flushing, for instance).
; is clustering enabled?
; which machines can issues requests (e.g., flushing) to the cluster?
; which servers are in the cluster? This server's IP may be included too
; N.B.: www1 =, www2 =, www3 =
; log clustering events?
(Of course, you'll want to replace the IP addresses with the actual IPs of the hosts in the cluster.)

Now when a server (say, invokes util_memoize_flush or util_memoize_seed, those routines use server_cluster_httpget_from_peers to issue an HTTP GET request to all machines in the cluster (omitting the local server):

causing the other machines ( and to flush the Tcl statement from their local caches. This is transparent and works with all existing code.

So don't think about it - just set up the server-cluster block in your yourservername.ini file, and util_memoize and friends will be happy.