Reputation: 19
We are trying to improve our app performance and are doing a performance testing. We have a Linux VM with 4 cores and 16 GB memory. The application has more then 100 users and are complaining of slowness. Here are the performance tuning we have done so far
<heap size="8192m" max-size="8192m"/>
***<jvm-options>
<option value="-XX:+UseG1GC"/>
<option value="-XX:+UseStringDeduplication"/>
<option value="-verbose:gc"/>
<option value="-XX:+PrintGCDetails"/>
<option value="-XX:+PrintGCDateStamps"/>
<option value="-XX:+PrintGCTimeStamps"/>
<option value="-XX:+PrintGCApplicationStoppedTime"/>
<option value="-XX:+UseGCLogFileRotation"/>
<option value="-XX:NumberOfGCLogFiles=5"/>
<option value="-XX:GCLogFileSize=3M"/>
<option value="-XX:-TraceClassUnloading"/>
<option value="-XX:+HeapDumpOnOutOfMemoryError"/>***
we are seeing a 11 second garbage collection time as below
2021-09-14T18:43:27.186+1000: 14806.057: [GC pause (G1 Evacuation Pause) (young), 0.1189389 secs]
[Parallel Time: 71.8 ms, GC Workers: 4]
[GC Worker Start (ms): Min: 14806057.7, Avg: 14806057.7, Max: 14806057.7, Diff: 0.1]
[Ext Root Scanning (ms): Min: 5.4, Avg: 6.9, Max: 8.9, Diff: 3.5, Sum: 27.5]
[Update RS (ms): Min: 7.2, Avg: 9.0, Max: 9.7, Diff: 2.6, Sum: 35.8]
[Processed Buffers: Min: 30, Avg: 33.2, Max: 38, Diff: 8, Sum: 133]
[Scan RS (ms): Min: 0.3, Avg: 0.3, Max: 0.3, Diff: 0.1, Sum: 1.2]
[Code Root Scanning (ms): Min: 0.0, Avg: 0.0, Max: 0.1, Diff: 0.1, Sum: 0.1]
[Object Copy (ms): Min: 54.7, Avg: 55.3, Max: 56.0, Diff: 1.4, Sum: 221.3]
[Termination (ms): Min: 0.0, Avg: 0.0, Max: 0.0, Diff: 0.0, Sum: 0.0]
[Termination Attempts: Min: 1, Avg: 1.0, Max: 1, Diff: 0, Sum: 4]
[GC Worker Other (ms): Min: 0.0, Avg: 0.1, Max: 0.1, Diff: 0.1, Sum: 0.3]
[GC Worker Total (ms): Min: 71.5, Avg: 71.6, Max: 71.6, Diff: 0.1, Sum: 286.2]
[GC Worker End (ms): Min: 14806129.2, Avg: 14806129.3, Max: 14806129.3, Diff: 0.1]
[Code Root Fixup: 0.0 ms]
[Code Root Purge: 0.0 ms]
[String Dedup Fixup: 16.8 ms, GC Workers: 4]
[Queue Fixup (ms): Min: 0.0, Avg: 0.0, Max: 0.1, Diff: 0.1, Sum: 0.1]
[Table Fixup (ms): Min: 16.0, Avg: 16.3, Max: 16.6, Diff: 0.6, Sum: 65.3]
[Clear CT: 0.5 ms]
[Other: 29.8 ms]
[Choose CSet: 0.0 ms]
[Ref Proc: 26.7 ms]
[Ref Enq: 0.9 ms]
[Redirty Cards: 0.1 ms]
[Humongous Register: 0.2 ms]
[Humongous Reclaim: 0.1 ms]
[Free CSet: 1.3 ms]
[Eden: 4072.0M(4072.0M)->0.0B(4096.0M) Survivors: 98304.0K->86016.0K Heap: 7267.0M(8192.0M)->3187.9M(8192.0M)]
[Times: user=0.38 sys=0.00, real=0.12 secs]
How do we bring it down? we are planning to add 32 GB memory to the server and have the heap size (min and max at 20 GB)
Upvotes: 1
Views: 1813
Reputation: 111
The total GC time in the log is 0.1189389 secs, which is about 118.9 ms instead of 11 seconds.
The MaxGCPauseMillis parameter in G1 is used to control the maximum pause time. The default value is 200 ms. If you want to reduce the pause time, you can consider setting MaxGCPauseMillis to the desired value.
Upvotes: 1