ParallelRefProcEnabled Ref Proc: 229ms+Dubbo 參數優化 GC日誌分析 DUMP. 內存分析

參數優化

-Xmx15G 
-Xms15G 
-XX:MaxDirectMemorySize=5G 
-XX:+UnlockExperimentalVMOptions 
-XX:G1NewSizePercent=5  
-XX:G1RSetUpdatingPauseTimePercent=1 
-XX:+ParallelRefProcEnabled 
-XX:MetaspaceSize=1G 
-XX:+UseG1GC 
-XX:G1MixedGCCountTarget=16 
-XX:StringTableSize=4000000 
-XX:+PrintStringTableStatistics 
-XX:+PrintGCDetails 
-XX:+PrintGCDateStamps 
-Xloggc:/data/logs/intelligent-mr-%p-%t.log 
-XX:+PrintGCApplicationConcurrentTime 
-XX:+PrintGCApplicationStoppedTime 
-XX:+HeapDumpOnOutOfMemoryError 
-XX:HeapDumpPath=/data/logs  
-Djava.net.preferIPv4Stack=true
-XX:G1MaxNewSizePercent=30 
-XX:InitiatingHeapOccupancyPercent=45
-XX:+UnlockDiagnosticVMOptions  
-XX:+PrintHeapAtGC
-XX:+PrintTenuringDistribution
-XX:G1HeapRegionSize=32M
-XX:MaxGCPauseMillis=100 
-XX:GCPauseIntervalMillis=200
-XX:+ParallelRefProcEnabled
-XX:+PrintReferenceGC

XX:ParallelGCThreads

結論

-XX:ParallelGCThreads=32 影響非常大,超時嚴重,默認效果最優(該場景下)

Region調節對比

結論

32m相對較好

-XX:G1MaxNewSizePercent=30 
-XX:InitiatingHeapOccupancyPercent=45
-XX:G1HeapRegionSize=8M

-XX:G1MaxNewSizePercent=30 
-XX:InitiatingHeapOccupancyPercent=45
-XX:G1HeapRegionSize=16M

-XX:G1MaxNewSizePercent=30 
-XX:InitiatingHeapOccupancyPercent=45
-XX:G1HeapRegionSize=32M

GC日誌分析

結論

開啓參數ParallelRefProcEnabled ref對象並行化處理

2021-05-28T10:10:38.532+0800: 444.869: [GC pause (G1 Evacuation Pause) (young)
Desired survivor size 402653184 bytes, new threshold 15 (max 15)
- age   1:    3103320 bytes,    3103320 total
- age   2:     178000 bytes,    3281320 total
- age   3:       3920 bytes,    3285240 total
- age   4:      98016 bytes,    3383256 total
- age   5:      70144 bytes,    3453400 total
- age   6:       3464 bytes,    3456864 total
- age   7:      99304 bytes,    3556168 total
- age   8:       4048 bytes,    3560216 total
- age   9:       4712 bytes,    3564928 total
- age  10:       2304 bytes,    3567232 total
- age  11:       4400 bytes,    3571632 total
- age  12:        864 bytes,    3572496 total
- age  13:       1032 bytes,    3573528 total
- age  14:       1304 bytes,    3574832 total
- age  15:        256 bytes,    3575088 total
, 0.2690707 secs]
   [Parallel Time: 34.7 ms, GC Workers: 13]
      [GC Worker Start (ms): Min: 444869.6, Avg: 444892.9, Max: 444903.7, Diff: 34.0]
      [Ext Root Scanning (ms): Min: 0.0, Avg: 3.8, Max: 21.7, Diff: 21.7, Sum: 49.6]
      [Update RS (ms): Min: 0.0, Avg: 0.1, Max: 0.4, Diff: 0.4, Sum: 1.7]
         [Processed Buffers: Min: 0, Avg: 3.4, Max: 21, Diff: 21, Sum: 44]
      [Scan RS (ms): Min: 0.0, Avg: 0.1, Max: 0.2, Diff: 0.2, Sum: 1.2]
      [Code Root Scanning (ms): Min: 0.0, Avg: 0.0, Max: 0.2, Diff: 0.2, Sum: 0.2]
      [Object Copy (ms): Min: 0.0, Avg: 0.8, Max: 2.3, Diff: 2.3, Sum: 10.6]
      [Termination (ms): Min: 0.0, Avg: 6.0, Max: 9.7, Diff: 9.7, Sum: 78.5]
         [Termination Attempts: Min: 1, Avg: 1.0, Max: 1, Diff: 0, Sum: 13]
      [GC Worker Other (ms): Min: 0.0, Avg: 0.1, Max: 0.2, Diff: 0.2, Sum: 0.7]
      [GC Worker Total (ms): Min: 0.2, Avg: 11.0, Max: 34.3, Diff: 34.1, Sum: 142.6]
      [GC Worker End (ms): Min: 444903.8, Avg: 444903.9, Max: 444904.0, Diff: 0.2]
   [Code Root Fixup: 0.1 ms]
   [Code Root Purge: 0.0 ms]
   [Clear CT: 1.9 ms]
   [Other: 232.3 ms]
      [Choose CSet: 0.0 ms]
      [Ref Proc: 229.3 ms]
      [Ref Enq: 0.6 ms]
      [Redirty Cards: 0.6 ms]
      [Humongous Register: 0.2 ms]
      [Humongous Reclaim: 0.0 ms]
      [Free CSet: 0.8 ms]
   [Eden: 6128.0M(6128.0M)->0.0B(752.0M) Survivors: 16.0M->16.0M Heap: 6415.2M(15.0G)->288.8M(15.0G)]
 [Times: user=1.24 sys=0.02, real=0.27 secs] 

2021-06-03T14:41:47.017+0800: 155609.008: 
[SoftReference, 0 refs, 0.0042561 secs]2021-06-03T14:41:47.021+0800: 155609.012: 
[WeakReference, 0 refs, 0.0010238 secs]2021-06-03T14:41:47.022+0800: 155609.014: 
[FinalReference, 5 refs, 0.0021924 secs]2021-06-03T14:41:47.025+0800: 155609.016: 
[PhantomReference, 0 refs, 0 refs, 0.0315034 secs]2021-06-03T14:41:47.056+0800: 155609.047: [JNI Weak Reference, 0.0000365 secs], 0.0575484 secs]

DUMP. 內存分析

結論

線程佔用threadLocal 較多,WeakRef較多,減少Dubbo線程數

<dubbo:provider timeout="1000" filter="notice" threadpool="fixed" threads="300" dispatcher="message" retries="0"/>

改爲

<dubbo:provider timeout="1000" filter="notice" threadpool="cached" threads="300" dispatcher="message" retries="0"/>

大盤線程數降低

E4

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章