We have two Coldfusion servers that have a huge performance difference running the exact same code on the exact same input data. The code in questions instantiates a large amount of CFCs (Coldfusion Components, which are similar to objects in OOP languages).

I compared the two servers by running Process Monitor and then calling the problematic code on both machines. I learned two things. First, Coldfusion opens CFC files every time it instantiates an object. Both servers do this, so it cannot be the cause of the performance difference. Second, the fast server opens the CFC files directly while the server with the performance problem seems to navigate its way through the path until it reaches the desired CFC file. It does this for every file, even the ones it has previously loaded, and because the code instantiates so many CFCs it becomes very slow. See below the partial Promon traces that show this behavior. It can take over 60 seconds for the slow server to do what the fast one does in 2 seconds.

Can anyone tell me what causes this behavior? Is it a Coldfusion setting? Since Coldfusion runs on top of Java, is it a Java setting? Is it an OS option? The fast server is running Windows XP and I think the slow server is a Windows Server 2003.

Bonus question: Coldfusion doesn't seem to perform any READ FILE operations on any of the CFC or CFM files. How can this be?

Sample of the fast server opening CFC files:

11:25:14.5588975    jrun.exe    QueryOpen                   C:\CF\wwwroot\APP\com\HtmlUtils.cfc
11:25:14.5592758    jrun.exe    CreateFile                  C:\CF\wwwroot\APP\com\HtmlUtils.cfc
11:25:14.5595024    jrun.exe    QueryBasicInformationFile   C:\CF\wwwroot\APP\com\HtmlUtils.cfc
11:25:14.5595940    jrun.exe    CloseFile                   C:\CF\wwwroot\APP\com\HtmlUtils.cfc
11:25:14.5599628    jrun.exe    CreateFile                  C:\CF\wwwroot\APP\com\HtmlUtils.cfc
11:25:14.5601600    jrun.exe    QueryBasicInformationFile   C:\CF\wwwroot\APP\com\HtmlUtils.cfc
11:25:14.5602463    jrun.exe    CloseFile                   C:\CF\wwwroot\APP\com\HtmlUtils.cfc

Equivalent sample of the slow server opening CFC files:

11:15:08.1249230    jrun.exe    CreateFile                  D:\
11:15:08.1250100    jrun.exe    QueryDirectory              D:\org
11:15:08.1252852    jrun.exe    CloseFile                   D:\
11:15:08.1259670    jrun.exe    CreateFile                  D:\org
11:15:08.1260319    jrun.exe    QueryDirectory              D:\org\cli
11:15:08.1260769    jrun.exe    CloseFile                   D:\org
11:15:08.1269451    jrun.exe    CreateFile                  D:\org\cli
11:15:08.1270613    jrun.exe    QueryDirectory              D:\org\cli\cpn
11:15:08.1271140    jrun.exe    CloseFile                   D:\org\cli
11:15:08.1279312    jrun.exe    CreateFile                  D:\org\cli\cpn
11:15:08.1280086    jrun.exe    QueryDirectory              D:\org\cli\cpn\APP
11:15:08.1280789    jrun.exe    CloseFile                   D:\org\cli\cpn
11:15:08.1291034    jrun.exe    CreateFile                  D:\org\cli\cpn\APP
11:15:08.1291709    jrun.exe    QueryDirectory              D:\org\cli\cpn\APP\com
11:15:08.1292224    jrun.exe    CloseFile                   D:\org\cli\cpn\APP
11:15:08.1300568    jrun.exe    CreateFile                  D:\org\cli\cpn\APP\com
11:15:08.1301321    jrun.exe    QueryDirectory              D:\org\cli\cpn\APP\com\HtmlUtils.cfc
11:15:08.1301843    jrun.exe    CloseFile                   D:\org\cli\cpn\APP\com
11:15:08.1312049    jrun.exe    CreateFile                  D:\org\cli\cpn\APP\com\HtmlUtils.cfc
11:15:08.1314409    jrun.exe    QueryBasicInformationFile   D:\org\cli\cpn\APP\com\HtmlUtils.cfc
11:15:08.1314633    jrun.exe    CloseFile                   D:\org\cli\cpn\APP\com\HtmlUtils.cfc
11:15:08.1315881    jrun.exe    CreateFile                  D:\
11:15:08.1316379    jrun.exe    QueryDirectory              D:\org
11:15:08.1316926    jrun.exe    CloseFile                   D:\
11:15:08.1330951    jrun.exe    CreateFile                  D:\org
11:15:08.1338656    jrun.exe    QueryDirectory              D:\org\cli
11:15:08.1339118    jrun.exe    CloseFile                   D:\org
11:15:08.1526468    jrun.exe    CreateFile                  D:\org\cli
11:15:08.1527295    jrun.exe    QueryDirectory              D:\org\cli\cpn
11:15:08.1527989    jrun.exe    CloseFile                   D:\org\cli
11:15:08.1531977    jrun.exe    CreateFile                  D:\org\cli\cpn
11:15:08.1532589    jrun.exe    QueryDirectory              D:\org\cli\cpn\APP
11:15:08.1533575    jrun.exe    CloseFile                   D:\org\cli\cpn
11:15:08.1538457    jrun.exe    CreateFile                  D:\org\cli\cpn\APP
11:15:08.1539083    jrun.exe    QueryDirectory              D:\org\cli\cpn\APP\com
11:15:08.1539553    jrun.exe    CloseFile                   D:\org\cli\cpn\APP
11:15:08.1544126    jrun.exe    CreateFile                  D:\org\cli\cpn\APP\com
11:15:08.1544980    jrun.exe    QueryDirectory              D:\org\cli\cpn\APP\com\HtmlUtils.cfc
11:15:08.1545482    jrun.exe    CloseFile                   D:\org\cli\cpn\APP\com
11:15:08.1551034    jrun.exe    CreateFile                  D:\org\cli\cpn\APP\com\HtmlUtils.cfc
11:15:08.1552878    jrun.exe    QueryBasicInformationFile   D:\org\cli\cpn\APP\com\HtmlUtils.cfc
11:15:08.1553044    jrun.exe    CloseFile                   D:\org\cli\cpn\APP\com\HtmlUtils.cfc


  • 1
    Who the hell is voting to close this? It's a very good question! What is wrong with you people? – Adam Cameron Nov 23 '12 at 15:10
  • 1
    I guess perhaps the question might better be asked on serverfault, but the problem is the attention ColdFusion questions get over there is a bit rubbish. It's better off being left here, and people to get over themselves. – Adam Cameron Nov 23 '12 at 15:14
  • 1
    They're not perfectly valid, Peter, because they haven't taken the time to attempt to help correct the problem. It's just typical S/O power-trip nazism. The object of the exercise here is not to slavishly follow rules and anonymously bully newbies, it's to HELP PEOPLE. – Adam Cameron Nov 23 '12 at 16:50
  • 2
    I'd agree this question is better suited for Server Fault: it's a system administration issue, not a code issue. – Billy Cravens Nov 23 '12 at 17:22
  • 1
    Adam, have you taken the time to attempt to help correct the problem? It seems you're just complaining where it almost certainly wont be seen by anyone relevant. If you want to have a chance of making a difference, complain on meta. – Peter Boughton Nov 23 '12 at 17:24

Along the lines of Adam Cameron's answer, I'd suggest comparing C:\ColdFusion8\lib\neo*.xml on both machines and working through the differences, particularly neo-runtime.xml and neo-debug.xml - these are where the config for ColdFusion are stored. Post any interesting differences here.

If you don't have a diff tool, use the trial version of BeyondCompare as it'll do whole directories and supports XML well.

  • I purchased Beyond Compare a while ago and use it more frequently than I ever anticipated. – Francis Gagnon Nov 27 '12 at 14:45
  • After more investigation and trying things out, I eventually found that the option "Security > Sandbox Security > Enable ColdFusion Security" is what causes the different behavior shown in the Process Monitor traces shown in my question. The page execution has slowed down on the fast server but is still faster than the slow server. Further comparison of the Procmon traces show that while the two servers now perform very similar operations, the slow server is still taking more time to do them. I have new questions, but at least I have my answer for this one. Thanks to everyone. – Francis Gagnon Nov 27 '12 at 14:53
  • 1
    Very glad you got to the bottom of it! Regarding BC, I really can't imagine how I got things done without it. – barnyr Nov 27 '12 at 20:51

It sounds to me like you don't have "Component cache" checked in CFAdmin (Server Settings > Caching) on the slow server.

Another possibility is that you've got different CF mappings (Server Settings > Mappings) and/or custom tag paths (Extensions > Custom Tag Paths) set between the two servers.

It's most likely to be the former though.

You could also set "Cache Template In Request" (Server Settings > Caching) to prevent the file look-up for the same CFC after the first one for a given request, and if it's a production server, check "Trusted cache" (Server Settings > Caching) too, which will prevent any file system look-ups if the file has already been loaded once.

ColdFusion will also only maintain a specific number of compiled files in memory at a time, set by "Maximum number of cached templates" (Server Settings > Caching), and you should try to set this to encompass the total number of CFML files (and CFC methods, each of which compile down to a class of their own) in your app. Obviously this is predicated on having enough RAM available to the JVM to handle this. It can be a bit of a balancing act.

  • Hi Adam, I should have mentioned that I am running Coldfusion8 Developer edition on the fast server and the full regular version of Coldfusion8 on the slow one. I don't seem to have all the caching options you are talking about. I'll speak with the server folks to see if their version has them. – Francis Gagnon Nov 23 '12 at 14:59
  • Ah, OK. The CF version (ie: full or dev) should not matter as far as I know. I don't have CF8 here to check on, but when I get home from work (+3h from now), I'll have a look for the CF8 equivs of those settings. – Adam Cameron Nov 23 '12 at 15:11
  • OK, there's no similar setting in CF8. Damn. Did you check the mappings & custom tag paths? Plus the other advice stands, although it is not part of the solution to this problem. Hopefully someone else will see this and give you some other suggestions. – Adam Cameron Nov 23 '12 at 20:22
  • Thanks Adam. I'll speak with the server admin to discuss these points with him, but it looks like the person I will be speaking with is not in today. I'll have to see about this early next week. – Francis Gagnon Nov 23 '12 at 20:37

Try checking:

  1. JVM Settings especially memory settings
  2. Make sure debug mode is off
  3. Virus scan settings. See if one has Java files skipped
  4. Check where cfdump is being used.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.