Creating A Good Redundant 64-bit Install Of ColdFusion
Posted by Mike Brunt at 7:10 AM
13 comments - Categories: Web Servers | ColdFusion | JRun-J2EE
We recently had a client for some advice on setting up a redundant installation of ColdFusion and SQL Server, here is what we answered to 14 key questions, our answers are surrounded by # #. Firstly, the client lead in surrounded by " ".
"We’re currently on a single application server with CF8 and a single database server with MS SQL Server 2000. OS for both is 32-bit Windows Server 2003. We use SeeFusion as our monitoring tool (we have CF8 Standard edition). We’re looking to move to an environment with 2 x application servers load balanced with CF8 Standard and 2 x database servers with MS SQL Server 2008 (either in Replication or Clustered). The code will be on a RAID-5 SAN shared by the application servers. OS for all servers will be 64-bit Windows Server 2003 or 2008. I believe we will be continuing with SeeFusion as our monitoring tool."
Q-1) Clustering CF? - If we have this set up with 2 application servers should we cluster CF or is it OK to leave them separated Can we use cluster 2 servers with CF8 Standard or will we require Enterprise edition?
A-1) #Considering that you are going to 64 bit and that you need CF Enterprise to cluster at the CF level I would not cluster CF. The main reason for doing so, is that on 32-bit systems we have an effective 1.4GB at max ceiling for the JVM so multiple instances with clustering allows us to have N Instances x 1.4GB, as you are moving to 64-bit the 1.4GB at max ceiling is no longer an issue. However with two web-CF servers you will need to cluster at least at the web server level which you can do with Windows NLB or at the overall server level with a hardware clustering device.#
Q-2) We use SESSION scope variable A LOT so we will need to use "sticky sessions" or "session replication". Is one better than the other?
A-2) #If you take my advice and do not cluster CF, session replication is not available and to be honest, I have found it somewhat unreliable. Definitely enable "round-robin with sticky sessions" in your clustering mechanism, it is the most effective and reliable clustering algorithm in our experience.#
Q-3) Will we encounter any problems if we leave the 2 x CF servers un-clustered?
A-3) #You will need to cluster them somehow as I mention above, either via NLB or a hardware clustering device#
Q-4) If we don’t cluster CF and go with the set up of 2 separate instances of ColdFusion CF Gotcha’s?
A-4) #My only thought here, which is not a gotcha as such, is that Client Variables are easier to deal with when clustering as they are always available to all users, however complex variables (structures etc) cannot be easily manipulated in the Client scope.#
Q-5) Are there any specific tags or features of our CF Application that we should be wary of when moving to a multiple CF server environment?
A-5) #As long as both CF servers are identical, no not that I can think of#
Q-6) We use SESSION variables A LOT but the load balancing uses sticky sessions so I’m hoping this will all be fine.
A-6) #Yes I mentioned this above, enable "round-robin with sticky sessions"#
Q-7) The system quite often has to convert resumes and other uploaded documents to PDF format, we use CFEXECUTE and JAVA classes to invoke the 3rd party PDF conversion tools. These tools are used quite a bit. [CFPDF doesn’t do what we need in CF8, I think CF9 will help us eliminate some of these 3rd party tools]
A-7) #I am always in favor of using native tools etc. In all of this it is imperative, in my opinion, that you thoroughly test everything before deploying to production.#
Q-8) CF Scheduled Tasks With 2 instances of ColdFusion we’ll have 2 instances of CF Admin. Which server should we set up the ColdFusion Scheduled Tasks and what happens if that server dies? For the tasks that are run at certain intervals all day we can have them set up on both servers with them running at staggered intervals so if one server fails the other will catch it the next time around. However, with tasks that should only be run once a day there is the potential for them to not run if the server is down at the time or twice if they are set up on both servers.
A-8) #I would keep this as simple as possible, set up the tasks on both servers but only activate one, leaving the tasks on the other ready to run but NOT running (active-passive) if the active server fails you can activate the Scheduled Tasks on the second server.#
Q 9) Do you have a recommended method for setting up Scheduled Tasks?
A-9) #This is one area where CF Enterprise with multiple instances can be really helpful as you can dedicate one instance to running the Scheduled Tasks which means that heavy processes will not impact the main web sites.#
Q-10) CF Locking - If CFLOCK is performed around a database call on Server 1 and then the same CFLOCK is made on Server 2 the 2nd CFLOCK will probably be granted and allowed to modify the database at the same time as server 1. Each server won’t know about the locks on the other server. I can see this could potentially cause a few issues. Is there a way to avoid this? Does the locking need to be done at the database level?
A-10) #Absolutely at the database level, I never advocate the use of CFLOCK with database transactions, for instance if shared scope variables are used in SQL statements etc, always localize the variables first. Further to this I am a firm believer in using Stored Procedures for database interactivity.#
Q-11) CF Settings Are there any CF settings we should tweak when moving to a multiple CF server environment?
A-11) #Not that I can think of but it is important to keep the settings the same, with the exception of Scheduled Tasks, as mentioned above.#
Q-12) Database Replication or Clustered?
A-12) #With SQL Server 2005-2008 STD there is a wonderful way to create a redundant data tier with mirroring and a witness server where you only require one SQL Server license, we have done this many times to good effect, it is a hefty subject to detail here but we could certainly help you with that.#
Q-13) The shortlist of hosting companies differ in their database server configuration. One company recommends Replication while the other recommends Clustered. My manager is leaning towards the Replication method.
A-13) #Very few companies know about mirroring and a witness server in SQL Server, I would ask your vendors about that and yes this would involve replication.#
Q-14) Do you recommend a certain method (or strongly recommend not going with a certain method) ?
A-14) #I am a big advocate of mirroring and a witness server in SQL Server.#
#One last important point, in 64-bit systems you should ideally have a minimum of 16GB Ram on the CF-web servers and ideally 32GB on the database servers.#
Claude wrote on 12/11/09 10:02 PM
In your answer, A-1, it's unclear to me how the 1.4GB ceiling is lifted by using software clustering with multiple instances. Isn't the JVM limited to 1.4GB, and each instance is managed by the container within that memory limit?Would you expand on A-14 a bit more. Why is 16GB ideal for a 64-bit system?
*I run the enterprise version on RedHat Linux.
Thanks,
Claude