Huge performance difference between two web servers, odd behavior seen using process monitor
- by Francis Gagnon
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
Thanks