Discover Which Coldfusion Server Being Used In Cluster

clustercoldfusionload balancing

We have a load balanced cluster of 2 servers for our Coldfusion applications. I'm encountering some weird behavior, and would like to find out which of the two servers a user is currently on when they are running the web application. Is there a way to find out which server is being used for specific requests?

The cgi.server variable only provides info like cfprod.domain.com and what I need is, cfprod1.domain.com or cfprod2.domain.com

Best Answer

You can get the CF Instance name using this: #GetMetricData("PERF_MONITOR").InstanceName#

The problem is that you probably don't have the metrics service enabled, since it is disabled by default on the Enterprise editions. I wouldn't be surprised if there is another way to get the instance name as well.