Memcached configuration options

From the previous discussion with Michael Long I realised that the memcached solution doesn't force you to only have a single centralised cache store. What it does is allow you to configure you caching in a more flexible manner (at the cost of adding another layer in).

For example, you could configure you caching in a number different ways:

Note that these are theoretical and I haven't yet tested these configurations, keen to hear if anyone else has/or does though.

Stable Performance

  • 1 memcached instance per server
  • 2 or 3 CF intances per server
Pros:
  • Ability to rolling restart CF instances without clearing cache
  • Ability to clear entire cache (or parts of it) for the server via cf template
  • More efficient memory usage than storing 1 copy per instance
  • Each instance can share work of other instances i.e. cache is generated by one server instead of each server
Cons:
  • Additional memcached layer

Maximum Performance

  • 2+ memcached instances shared across cluster
  • 2 or 3 CF intances per server
Pros:
  • Ability to rolling restart CF instances without clearing cache
  • Ability to clear entire cache for cluster (or parts of it) for the server via cf template
  • Very efficient memory usage across entire cluster
  • Each instance can share work of other instances across cluster i.e. cache is generated by one server instead of each server
Cons:
  • Performance degration of particular pages if memcached server holding specific cache is down.

CF Emulation

  • 1 memcached instance per cf instance
  • 1 CF intances per memcache
Pros:
  • Each CF instance has dedicated cache
  • CF memory is only used for requests not caching
Cons:
  • Dependancy on memcached

One of the reasons that I'm keen to move the cache data out of the CF process is that I've found CF to become unstable when it's using all it's memory and this is an elegant way of removing some of the memory usage. Also the JVM seems to have limits on how much ram it can use. This way it leaves all the memory in CF for processing requests.

Comments
BlogCFC was created by Raymond Camden. This blog is running version 5.1.004.