In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/03 Report--
Take hbase as an example: under the configuration file path of hbase, set the GC log output path / app/hbase-config/hbase-env.sh
Export HBASE_OPTS= "- Xmx16384m-Xms16384m-Xmn8192m-XX:PermSize=160M-XX:MaxPermSize=160M-XX:+UseConcMarkSweepGC-XX:+UseParNewGC-XX:CMSInitiatingOccupancyFraction=70-XX:+UseCMSCompactAtFullCollection-XX:CMSFullGCsBeforeCompaction=3-XX:+CMSParallelRemarkEnabled-verbose:gc-XX:+PrintGCDetails-XX:+PrintGCTimeStamps-XX:+PrintGCDateStamps-XX:+PrintGCApplicationConcurrentTime-XX:+PrintGCApplicationStoppedTime-XX:PrintFLSStatistics=1-Xloggc:/app/hbase/logs/hbase_gc.log $HBASE_OPTS"
Information about log can be queried.
# jstat-gccause 79751 1000 1000 / / obtain GC-related metrics, indicating that 79751 garbage collection status is queried every 1000 milliseconds.
Usage: jstat-help |-options
Jstat-[- t] [- h] [[]]
Parameter explanation:
Options-option. We usually use-gcutil to check gc.
The process number of vmid-VM, that is, the java process number that is currently running
Interval- interval (in seconds or milliseconds)
Count-number of times to print, or countless times by default
S0 S1 E O P YGC YGCT FGC FGCT GCT LGCC GCC 0.00 8.98 11.16 69.83 12.33 156 50.788 16 280.103 330.891 unknown GCCause No GC 0.00 8.98 12.79 69.83 12.33 156 50.788 16 280.103 330.891 unknown GCCause No GC 0.00 8.98 14.94 69 . 83 12.33 156 50.788 16 280.103 330.891 unknown GCCause No GC 0.00 8.98 16.04 69.83 12.33 156 50.788 16 280.103 330.891 unknown GCCause No GC 0.00 8.98 17.98 69.83 12.33 156 50.788 16 280.103 330.891 unknown GCCause No GC 0.00 8.98 20.34 69.83 12.33 156 50.788 16 280.103 330.891 unknown GCCause No GC 0.00 8.98 21.83 69.83 12.33 156 50.788 16 280.103 330.891 unknown GCCause No GC 0.00 8.98 22.64 69.83 12.33 156 50.788 16 280.103 330.891 unknown GCCause No GC
Column E represents
O Emure-> O the new generation transfers to the older generation, and full gc will be triggered when O accumulates to 80%.
The specific meaning is as follows:
E (for Eden), the new generation Eden zone representing this server uses 11.16% of the space.
There are two Survivor zones in S0S1 (S0PowerS1 means Survivor0 and Survivor1). The Survivor0 is empty, and Survivor1 accounts for 8.98%.
The old age (O, for old) and the permanent belt (P, for Permanent) used 69.83% and 12.33% of the space, respectively.
Since the program was run, Minor GC (YGC, which means young gc) has occurred 156 times, and the total time is 50.788 seconds.
Fulle GC (FGC, for full GC) occurs 16 times, full GC total time (FGCT, for full gc time) is 330.891 seconds, and total GC time (GCT, for GC Time) is 330.891 seconds
LGCC Cause of last Garbage Collection.
GCC Cause of current Garbage Collection.
The Java 6 JDK output is as follows:
[hadoop@0321 logs] $jmap-heap 29877
Attaching to process ID 29877 Please wait...Debugger attached successfully.Server compiler detected.JVM version is 20.45-b01using parallel threads in the new generation.using thread-local object allocation.Concurrent Mark-Sweep GCHeap Configuration: MinHeapFreeRatio = 40 MaxHeapFreeRatio = 70 MaxHeapSize = 21474836480 (20480.0MB) NewSize = 4294967296 (4096.0MB) MaxNewSize = 4294967296 (4096.0MB) OldSize = 5439488 (5.1875MB) NewRatio = 2 SurvivorRatio = 8 PermSize = 67108864 (64.0MB) MaxPermSize = 67108864 (64.0MB) Heap Usage:New Generation (Eden + 1 Survivor Space): capacity = 3865509888 (3686.4375MB) used = 481048576 (458.763671875MB) free = 3384461312 (3227.673828125MB) 12.444634470949257% usedEden Space: capacity = 3436052480 (3276.875MB) used = 481048576 (458.763671875MB) free = 2955003904 (2818.111328125MB) 14.003576196834 usedFrom Space: capacity = 429457408 (409.5625MB) used = 0 (0.0MB) free = 429457408 (409.5625MB) 0.0% usedTo Space: capacity = 429457408 (409.5625MB) used = 0 (0.0MB) free = 429457408 (409.5625MB) 0.0% usedconcurrent mark-sweep generation: capacity = 12884901888 (12288.0MB) used = 0 (0.0MB) free = 12884901888 (12288.0MB) 0.0% usedPerm Generation: capacity = 67108864 (64.0MB) used = 21153816 (20.173851013183594MB) free = 45955048 (43.826148986816406MB) 31.521642208099365% usedEden from to add up to Young area
[hbase@0321 ~] $jps
10424 Jps
8229 HRegionServer
[hbase@0321 ~] $jmap-heap 8229
Attaching to process ID 8229, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 24.71-b01
Using thread-local object allocation.
Garbage-First (G1) GC with 6 thread (s)
Heap Configuration:
MinHeapFreeRatio = 40
MaxHeapFreeRatio = 70
MaxHeapSize = 25769803776 (24576.0MB)
NewSize = 1363144 (1.2999954223632812MB)
MaxNewSize = 17592186044415 MB
OldSize = 5452592 (5.1999969482421875MB)
NewRatio = 2
SurvivorRatio = 8
PermSize = 16777216 (16.0MB)
MaxPermSize = 83886080 (80.0MB)
G1HeapRegionSize = 8388608 (8.0MB)
Heap Usage:
G1 Heap:
Regions = 3072
Capacity = 25769803776 (24576.0MB)
Used = 20409483264 (19464.0MB)
Free = 5360320512 (5112.0MB)
79.19921875% used
G1 Young Generation:
Eden Space:
Regions = 89
Capacity = 1182793728 (1128.0MB)
Used = 746586112 (712.0MB)
Free = 436207616 (416.0MB)
63.12056737588652% used
Survivor Space:
Regions = 20
Capacity = 167772160 (160.0MB)
Used = 167772160 (160.0MB)
Free = 0 (0.0MB)
100.0% used
G1 Old Generation:
Regions = 2324
Capacity = 24419237888 (23288.0MB)
Used = 19495124992 (18592.0MB)
Free = 4924112896 (4696.0MB)
79.83510821023704 used
Perm Generation:
Capacity = 50331648 (48.0MB)
Used = 42303832 (40.344078063964844MB)
Free = 8027816 (7.655921936035156MB)
84.05016263326009 used
G1 GC Notes:
About the maximum gc pause time
When doing minor gc and mixed gc, the collector maintains a remembered set in memory, and this set contains references to all objects in the heap to determine which can be recycled.
During each gc, G1 uses a prediction model to calculate the collection time of each region, so that the region with a pause time within the MaxGCPauseMillis is selected for garbage collection.
About mixed gc
Mixed gc is a garbage collection method that reclaims both young area and old area. The condition that it triggers is that the purpose of-XX:InitiatingHeapOccupancyPercent,mixed gc is to delay the generation of full gc.
By the same token, YGC refers to the garbage collection method of recycling young.
Full GC refers to the garbage collection method used to collect Old. Because the old area is relatively large, resulting in a long GC time, and during the GC period, the java process stops responding externally, and the java process does not respond externally. As a result, regionserver cannot register heartbeat information with zookeeper. If it exceeds the zookeeper (zookeeper.session.timeout) session time, it will be set as dead by zookeeper.
Hbase G1 parameter adjustment:
The parameters to be modified. To modify the parameters of GC, you need to restart the cluster, which is scheduled for the next restart.
-XX:ConcGCThreads=12 concurrent mark number of execution threads = test data ConcGCThreads cannot be greater than-XX:ParallelGCThreads, otherwise an error will be reported
-GC is triggered when the XX:InitiatingHeapOccupancyPercent=60 heap is occupied. The default is 45.
-XX:ParallelGCThreads=12 30
[hbase@0321 ~] $jstat-gccapacity 61540
NGCMN NGCMX NGC S0C S1C EC OGCMN OGCMX OGC OC PGCMN PGCMX PGC PC YGC FGC
0.0 52428800.0 2490368.0 0.0 294912.0 2195456.0 0.0 52428800.0 44695552.0 44695552.0 16384.0 81920.0 49152.0 49152.0 20
Common GC commands:
[hbase@ 0321] $jmap-heap 61540
Attaching to process ID 61540 Please wait...Debugger attached successfully.Server compiler detected.JVM version is 24.71-b01using thread-local object allocation.Garbage-First (G1) GC with 30 thread (s) Heap Configuration: MinHeapFreeRatio = 40 MaxHeapFreeRatio = 70 MaxHeapSize = 53687091200 (51200.0MB) NewSize = 1363144 (1.2999954223632812MB) MaxNewSize = 17592186044415 MB OldSize = 5452592 (5.1999969482421875MB) NewRatio = 2 SurvivorRatio = 8 PermSize = 16777216 (16. 0MB) MaxPermSize = 83886080 (80.0MB) G1HeapRegionSize = 16777216 (16.0MB) Heap Usage:G1 Heap: regions = 2880 capacity = 48318382080 (46080.0MB) used = 2519304864 (2402.5963439941406MB) free = 45799077216 (43677.40365600586MB) 5.213967760403951% usedG1 Young Generation:Eden Space: regions = 7 capacity = 2248146944 (2144.0MB) used = 117440512 (112.0MB) free = 2130706432 (2032.0MB) 5.223880597014926% usedSurvivor Space: = 18 capacity = 301989888 (288.0MB) used = 301989888 (288.0MB) free = 0 (0.0MB) 100.0% usedG1 Old Generation: regions = 126 capacity = 45768245248 (43648.0MB) used = 2099874464 (2002.5963439941406MB) free = 43668370784 (41645.40365600586MB) 4.5880598057051% usedPerm Generation: capacity = 50331648 (48.0MB) used = 42610464 (40.636505126953125MB) free = 7721184 (7.363494873046875MB) 84.65938568115234 used13018 interned Strings occupying 1388240 bytes.
[hbase@0321] $jstat-gccause-h 10 61540 1000 1000
S0 S1 E O P YGC YGCT FGC FGCT GCT LGCC GCC 0.00 100.00 92.54 20.26 85.06 16 1.794 0 0.000 1.794 G1 Evacuation Pause No GC 0.00 100.00 92.54 20.26 85.06 16 1.794 00.00 0 1.794 G1 Evacuation Pause No GC 0.00 100.00 92 . 54 20.26 85.06 16 1.794 0 0.000 1.794 G1 Evacuation Pause No GC 0.00 100.00 93.28 20.26 85.06 16 1.794 0 0.000 1.794 G1 Evacuation Pause No GC 0.00 100.00 93.28 20.26 85.06 16 1.794 0 0.000 1.794 G1 Evacuation Pause No GC 0.00 100.00 93.28 20.26 85 . 06 16 1.794 0 0.000 1.794 G1 Evacuation Pause No GC 0.00 100.00 1.42 21.24 85.06 17 1.877 0 0.000 1.877 G1 Evacuation Pause No GC 0.00 100.00 1.42 21.24 85.06 17 1.877 0 0.000 1.877 G1 Evacuation Pause No GC 0.00 100.00 3.55 21.24 85.06 17 1.877 0 0.000 1.877 G1 Evacuation Pause No GC 0.00 100.00 3.55 21.24 85.06 17 1.877 0 0.000 1.877 G1 Evacuation Pause No GC S0 S1 E O P YGC YGCT FGC FGCT GCT LGCC GCC 0.00 100.00 3.55 21.24 85.06 17 1. 877 0 0.000 1.877 G1 Evacuation Pause No GC 0.00 100.00 3.55 21.24 85.06 17 1.877 0 0.000 1.877 G1 Evacuation Pause No GC 0.00 100.00 3.55 21.24 85.06 17 1.877 0 0.000 1.877 G1 Evacuation Pause No GC 0.00 100.00 3.55 21.24 85.06 17 1.877 0 0.000 1.877 G1 Evacuation Pause No GC 0.00 100.00 3.55 21.24 85.06 17 1.877 0 0.000 1.877 G1 Evacuation Pause No GC 0.00 100.00 3.55 21.24 85.06 17 1.877 0 0.000 1.877 G1 Evacuation Pause No GC 0.00 100.00 4.26 21.24 85.06 17 1.877 00 . 000 1.877 G1 Evacuation Pause No GC 0.00 100.00 4.26 21.24 85.06 17 1.877 0 0.000 1.877 G1 Evacuation Pause No GC 0.00 100.00 4.26 21.24 85.06 17 1.877 0 0.000 1.877 G1 Evacuation Pause No GC 0.00 100.00 4.26 21.24 85.06 17 1.877 0 0.000 1.877 G1 Evacuation Pause No GC S0 S1 E O P YGC YGCT FGC FGCT GCT LGCC GCC 0.00 100.00 4.26 21.24 85.06 17 1.877 0 0.000 1.877 G1 Evacuation Pause No GC 0.00 100.00 4.26 21.24 85.06 17 1.877 0 0.000 1.877 G1 Evacuation Pause No GC 0.00 100.00 4.26 21.24 85.06 17 1.877 0 0.000 1.877 G1 Evacuation Pause No GC 0.00 100.00 4.26 21.24 85.06 17 1.877 0 0.000 1.877 G1 Evacuation Pause No GC 0.00 100.00 4.26 21.24 85.06 17 1.877 0 0.000 1.877 G1 Evacuation Pause No GC
# jstat-gcutil 27912 1s 50
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 287
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.