Coldbox Caching Issues on a Cluster

I have a cluster of 2 web servers running ColdFusion 8 Professional
with basic file replication software installed. I built a basic app
using client variables (my first attempt at work with client
variables), and everything went smooth.

The project that I am currently working on is using the ColdBox
framework (on the cluster). I've done a few days of research, but
haven't been able to answer my question - Do I need to do anything to
the core system files to work on the cluster (i.e. use clientstorage
instead of sessionstorage)? I am coding my app using the
clientstorage plugin and so far everything seems to be going ok. The
only thing I was able to find that I needed to change was the <Setting
name="MessageBoxStorage" value="client"/> in the settings.xml file
(but that is rather insignificant)

Another oddity I've noticed is this: Lets say I'm working on a method
in one of my models. I'll test some code, see its not working, go
back and change the code, test it again, and it will work. For some
reason a few more tests down the line, its like my code reverts back
to previous code randomly (which wasn't working). I'm seeing cf
function calls that I deleted LONG ago. My guess is this code is
caching, and I'm wondering if its a caching problem with the cluster
(like I said, maybe one server is clearing the cache and the other
isn't when I click the clear cache button in the sidebar).

Thanks for any/all help!

-Ryan

Re: Code “reverting” back

If you’re caching models of your app, those models are cached per server. The “clear cache” button would only clear the cache on the server that the request runs on. It has no idea about the cluster. What I believe is happening is, you refresh the cache on one server and everything is good. But when you’re sent to the second server in the cluster, everything is not all good because it still has old versions of the models cached.

You may want to look into the Deployment Interceptor and incorporate the tag file it uses into your replication. That way, each server in the cluster will reinit itself when a new request comes in because of the change in the tagfile.

http://ortus.svnrepository.com/coldbox/trac.cgi/wiki/cbDeploy

  • Gabriel

I could have not said it better. These are typical problems when dealing with clustered environments. The deploy interceptor was done to alleviate this problem.

However, we are also developing a Cluster Communications solution that will be available soon. It is called ColdBox Messaging. Which will give you the ability to sync up servers in a cluster for specific coldbox applications. Lots of futures I will be releasing in the future. However, it won’t be open source :slight_smile:

Luis

Outstanding! I read a little about that depolyment interceptor and
sounded like it would do the job nicely.

I actually made the decision to just drop the cluster during
development and build "with the cluster in mind", so when I have my
beta, I'll load the cluster back up and debug from there. Its just
too much of a headache to deal with right now.

As for the core CB system files...those are all cluster friendly AS
IS, correct Luis? I had a weird login issue with the dashboard (I had
to log in to each server).