10 Steps To A Stable and Performant Web Application - Step 4
Posted by Mike Brunt at 6:33 AM
6 comments - Categories: ColdFusion | JRun-J2EE
In this step we will use both the Metrics Logging output and the Verbose GC logging output to adjust the overall memory size and to help to stop ColdFusion hanging. We will also adjust the size of each segment of the JVM memory space by passing arguments to the jvm.config file.
Here are links to the first three steps in this series.
Step 1 - Inspect Production ColdFusion Logs (no older than 7 days).
Step 2 - Enable Enhanced ColdFusion Logging (Metrics Logging).
Step 3 - Enable Enhanced ColdFusion Logging (Verbose Garbage Collection Logging).
These are the resukts of the Metrics and Verbose GC Logging...
Metrics Logging Output:
01/05 12:17:09 metrics Web threads (busy/total/wait): 1/28/0 Sessions: 1 Total Memory=520048 Free=158060
01/05 12:18:09 metrics Web threads (busy/total/wait): 1/28/0 Sessions: 1 Total Memory=520432 Free=215408
01/05 12:19:09 metrics Web threads (busy/total/wait): 1/28/0 Sessions: 1 Total Memory=520984 Free=164688
01/05 12:20:09 metrics Web threads (busy/total/wait): 1/27/0 Sessions: 1 Total Memory=520000 Free=93655
01/05 12:21:09 metrics Web threads (busy/total/wait): 1/27/0 Sessions: 1 Total Memory=520832 Free=58571
01/05 12:22:09 metrics Web threads (busy/total/wait): 1/27/0 Sessions: 1 Total Memory=520792 Free=83309
01/05 12:23:09 metrics Web threads (busy/total/wait): 1/27/0 Sessions: 1 Total Memory=520496 Free=105955
Verbose GC Output:
PSYoungGen total 55360K, used 55360K [0x2bef0000, 0x2f7d0000, 0x2f7d0000)
eden space 52608K, 100% used [0x2bef0000,0x2bef0000,0x2f250000)
from space 2752K, 67% used [0x2f250000,0x2f422630,0x2f500000)
to space 2816K, 0% used [0x2f510000,0x2f510000,0x2f7d0000
We will use this output to add/modify the arguments to the JVM via the jvm.config file…
Defaults in a new CF install - java.args=-server -Xmx512m XX:MaxPermSize=192m
Modified - java.args=-server -Xms1024m –Xmx1024m -XX:PermSize=96m -XX:MaxPermSize=192m -XX:NewRatio=3
This will start the heap with 1GB of space with the same max ceiling value, give the Permanent Generation a start size of 96MB and allocate one quarter of the total heap size (256MB) to the New/Young Generation.
As with all in this series these actions are not theoretical or simply lab based, these are based on succesful projects we carried out on behalf of clients who had ColdFusion performance problems.
We will be at CFObjective 09 in Minneapolis-St Paul and will be presenting "Indiana Jones and The Server of Doom" at 10:15AM on Thursday May 14 and also holding a BOF on all things ColdFusion in the Enterprise at 7:00PM on Friday May 16.
Abraham Lloyd wrote on 05/13/09 8:09 AM
Mike, great series. I think a series like this has been missing from the community for a long time, going all the way back to CF 6. Robi Sen and Spike had a few articles about JVM / server tuning, but its nice to see something more current / relevant that also focuses on process and task mechanics while explaining the changes.I was curious -- what tool(s) do you use to review GC logs, JVM memory utilization, etc? I think that would be a nice addition to the articles.
Again, great work. I'm looking forward to read the rest of the series.