httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff Thorpe <>
Subject Update on distcache support
Date Thu, 03 Apr 2003 19:48:49 GMT
Hi all,

I've attached a patch for the current head of CVS that represents the
latest state of distcache support. This includes the autoconf hooks so
that, if mod_ssl is configured to be built, distcache support will be
probed for and enabled if found. If --enable-distcache is specified then
failure to autodetect distcache support will be considered an error, and
if --disable-distcache is specified then the distcache probes and
configuration steps are bypassed.

If anyone feels motivated to help review this, please grab the
appropriate bundle of distcache version 0.4pre2 from
There are (experimental) precompiled RPMs of distcache available for
x86, as well as source code of course. The support attached to this
email supercedes the apache-2 support packages at so
please don't try to combine them - only distcache itself is required.

Once you have distcache's tools, libraries and headers installed, you
can hook things up with apache as follows;

 - start a cache server, eg;
   # dc_server -daemon -listen IP:9001
 - start a local proxy for the web-server to use, eg;
   # dc_client -daemon -listen UNIX:/tmp/dc_client \
                       -server IP:localhost:9001

 - configure, compile, and install apache using the attached patch
   *after* you've installed the distcache headers and libraries.
 - change the SSLSessionCache directive to use distcache, eg;
     SSLSessionCache dc:UNIX:/tmp/dc_client

That should be all that's required beyond the normal apache/mod_ssl
setup. I've tested this as best I can on the systems I have access to
and have observed no problems, ie. no known bugs - I'm keen to get
results from any "out of the ordinary" environments. If you set up
additional servers to test shared caching, give each its own instance of
"dc_client" with the "-server" switch pointing to the machine (and port)
that dc_server is listening on. It should work with hostname resolution
as well as dotted-numeric IP addresses (eg. "IP:",
"IP:cache-server.localnet:9001", etc). If everything is running on the
same host, you can elect to stick with unix domain addresses instead of
IPv4 for dc_server if you prefer.

If you're at a lost for testing apache's session caching behaviour, you
can try swamp at;
It is written for this kind of thing and it supports multiple
destination addresses using arbitrary "distribution" patterns and
arbitrary session resume patterns. Eg;

  # swamp -cipher RC4-MD5 -num 10 -count 20000 -update 10 \
          -connect server1.localnet:443 \
          -connect server2.localnet:443 \
          -connect server3.localnet:443 \
          -session "srrrsrr" \
          -distribute 1,2,3,2

The above example will, in each of the 10 parallel "contexts", send each
subsequent request to servers 1, 2, 3, and then 2 again before starting
over - so server2 gets twice as many requests as server1 and server3.
Moreover, this pattern cycles every 4 requests, whereas the
session-resumption pattern "srrrsrr" has period 7 so things should mix
up nicely ("s" means neogitate a new session, "r" means try to resume
the last session we successfully negotiated). This will cause each web
server to try resuming SSL/TLS sessions previously negotiated by other
servers, and the statistics generated by swamp will display how many of
these resume attempts succeed.

Another aspect of this I would like help with is the stability of the
whole architecture as/when various services are interrupted and/or
restarted. The distcache side *should* be robust against crashes and/or
network interruptions, eg. if dc_client and/or dc_server are killed off
and then restarted at some point things should automatically re-organise
themselves on the fly. Apache's session caching should fail gracefully
if one of the components is shut-off or the distcache networking
disappears (which swamp will show with failed resume stats), and should
start working again automatically once the problem is resolved. Any
behaviour to the contrary is a bug.

If anyone is interested in this, please consider popping over to the
distcache-users mail list.


Geoff Thorpe

View raw message