hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hadoop QA (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-17072) CPU usage starts to climb up to 90-100% when using G1GC; purge ThreadLocal usage
Date Mon, 28 Nov 2016 21:26:59 GMT

    [ https://issues.apache.org/jira/browse/HBASE-17072?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15703182#comment-15703182
] 

Hadoop QA commented on HBASE-17072:
-----------------------------------

| (x) *{color:red}-1 overall{color}* |
\\
\\
|| Vote || Subsystem || Runtime || Comment ||
| {color:blue}0{color} | {color:blue} reexec {color} | {color:blue} 0m 14s {color} | {color:blue}
Docker mode activated. {color} |
| {color:green}+1{color} | {color:green} @author {color} | {color:green} 0m 0s {color} | {color:green}
The patch does not contain any @author tags. {color} |
| {color:red}-1{color} | {color:red} test4tests {color} | {color:red} 0m 0s {color} | {color:red}
The patch doesn't appear to include any new or modified tests. Please justify why no new tests
are needed for this patch. Also please list what manual steps were performed to verify this
patch. {color} |
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 1m 35s {color}
| {color:green} branch-1 passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 28s {color} |
{color:green} branch-1 passed with JDK v1.8.0_111 {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 32s {color} |
{color:green} branch-1 passed with JDK v1.7.0_80 {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 50s {color}
| {color:green} branch-1 passed {color} |
| {color:green}+1{color} | {color:green} mvneclipse {color} | {color:green} 0m 15s {color}
| {color:green} branch-1 passed {color} |
| {color:red}-1{color} | {color:red} findbugs {color} | {color:red} 1m 43s {color} | {color:red}
hbase-server in branch-1 has 2 extant Findbugs warnings. {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 23s {color} |
{color:green} branch-1 passed with JDK v1.8.0_111 {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 32s {color} |
{color:green} branch-1 passed with JDK v1.7.0_80 {color} |
| {color:green}+1{color} | {color:green} mvninstall {color} | {color:green} 0m 37s {color}
| {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 28s {color} |
{color:green} the patch passed with JDK v1.8.0_111 {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 28s {color} | {color:green}
the patch passed {color} |
| {color:green}+1{color} | {color:green} compile {color} | {color:green} 0m 33s {color} |
{color:green} the patch passed with JDK v1.7.0_80 {color} |
| {color:green}+1{color} | {color:green} javac {color} | {color:green} 0m 33s {color} | {color:green}
the patch passed {color} |
| {color:green}+1{color} | {color:green} checkstyle {color} | {color:green} 0m 52s {color}
| {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} mvneclipse {color} | {color:green} 0m 15s {color}
| {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} whitespace {color} | {color:green} 0m 0s {color}
| {color:green} The patch has no whitespace issues. {color} |
| {color:green}+1{color} | {color:green} hadoopcheck {color} | {color:green} 14m 6s {color}
| {color:green} The patch does not cause any errors with Hadoop 2.4.0 2.4.1 2.5.0 2.5.1 2.5.2
2.6.1 2.6.2 2.6.3 2.7.1. {color} |
| {color:green}+1{color} | {color:green} hbaseprotoc {color} | {color:green} 0m 14s {color}
| {color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} findbugs {color} | {color:green} 1m 56s {color} |
{color:green} the patch passed {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 24s {color} |
{color:green} the patch passed with JDK v1.8.0_111 {color} |
| {color:green}+1{color} | {color:green} javadoc {color} | {color:green} 0m 31s {color} |
{color:green} the patch passed with JDK v1.7.0_80 {color} |
| {color:green}+1{color} | {color:green} unit {color} | {color:green} 85m 12s {color} | {color:green}
hbase-server in the patch passed. {color} |
| {color:green}+1{color} | {color:green} asflicense {color} | {color:green} 0m 19s {color}
| {color:green} The patch does not generate ASF License warnings. {color} |
| {color:black}{color} | {color:black} {color} | {color:black} 112m 28s {color} | {color:black}
{color} |
\\
\\
|| Subsystem || Report/Notes ||
| Docker | Client=1.12.3 Server=1.12.3 Image:yetus/hbase:e01ee2f |
| JIRA Patch URL | https://issues.apache.org/jira/secure/attachment/12840700/HBASE-17072.branch-1.001.patch
|
| JIRA Issue | HBASE-17072 |
| Optional Tests |  asflicense  javac  javadoc  unit  findbugs  hadoopcheck  hbaseanti  checkstyle
 compile  |
| uname | Linux f49a32d26a77 4.4.0-43-generic #63-Ubuntu SMP Wed Oct 12 13:48:03 UTC 2016
x86_64 x86_64 x86_64 GNU/Linux |
| Build tool | maven |
| Personality | /testptch/patchprocess/precommit/personality/hbase.sh |
| git revision | branch-1 / 10c0708 |
| Default Java | 1.7.0_80 |
| Multi-JDK versions |  /usr/lib/jvm/java-8-oracle:1.8.0_111 /usr/lib/jvm/java-7-oracle:1.7.0_80
|
| findbugs | v3.0.0 |
| findbugs | https://builds.apache.org/job/PreCommit-HBASE-Build/4651/artifact/patchprocess/branch-findbugs-hbase-server-warnings.html
|
|  Test Results | https://builds.apache.org/job/PreCommit-HBASE-Build/4651/testReport/ |
| modules | C: hbase-server U: hbase-server |
| Console output | https://builds.apache.org/job/PreCommit-HBASE-Build/4651/console |
| Powered by | Apache Yetus 0.3.0   http://yetus.apache.org |


This message was automatically generated.



> CPU usage starts to climb up to 90-100% when using G1GC; purge ThreadLocal usage
> --------------------------------------------------------------------------------
>
>                 Key: HBASE-17072
>                 URL: https://issues.apache.org/jira/browse/HBASE-17072
>             Project: HBase
>          Issue Type: Bug
>          Components: Performance, regionserver
>    Affects Versions: 1.0.0, 2.0.0, 1.2.0
>            Reporter: Eiichi Sato
>         Attachments: HBASE-17072.branch-1.001.patch, HBASE-17072.master.001.patch, HBASE-17072.master.002.patch,
HBASE-17072.master.003.patch, HBASE-17072.master.004.patch, HBASE-17072.master.005.patch,
HBASE-17072.master.005.patch, disable-block-header-cache.patch, mat-threadlocals.png, mat-threads.png,
metrics.png, slave1.svg, slave2.svg, slave3.svg, slave4.svg
>
>
> h5. Problem
> CPU usage of a region server in our CDH 5.4.5 cluster, at some point, starts to gradually
get higher up to nearly 90-100% when using G1GC.  We've also run into this problem on CDH
5.7.3 and CDH 5.8.2.
> In our production cluster, it normally takes a few weeks for this to happen after restarting
a RS.  We reproduced this on our test cluster and attached the results.  Please note that,
to make it easy to reproduce, we did some "anti-tuning" on a table when running tests.
> In metrics.png, soon after we started running some workloads against a test cluster (CDH
5.8.2) at about 7 p.m. CPU usage of the two RSs started to rise.  Flame Graphs (slave1.svg
to slave4.svg) are generated from jstack dumps of each RS process around 10:30 a.m. the next
day.
> After investigating heapdumps from another occurrence on a test cluster running CDH 5.7.3,
we found that the ThreadLocalMap contain a lot of contiguous entries of {{HFileBlock$PrefetchedHeader}}
probably due to primary clustering.  This caused more loops in {{ThreadLocalMap#expungeStaleEntries()}},
consuming a certain amount of CPU time.  What is worse is that the method is called from RPC
metrics code, which means even a small amount of per-RPC time soon adds up to a huge amount
of CPU time.
> This is very similar to the issue in HBASE-16616, but we have many {{HFileBlock$PrefetchedHeader}}
not only {{Counter$IndexHolder}} instances.  Here are some OQL counts from Eclipse Memory
Analyzer (MAT).  This shows a number of ThreadLocal instances in the ThreadLocalMap of a single
handler thread.
> {code}
> SELECT *
> FROM OBJECTS (SELECT AS RETAINED SET OBJECTS value
> 			  FROM OBJECTS 0x4ee380430) obj
> WHERE obj.@clazz.@name = "org.apache.hadoop.hbase.io.hfile.HFileBlock$PrefetchedHeader"
> #=> 10980 instances
> {code}
> {code}
> SELECT *
> FROM OBJECTS (SELECT AS RETAINED SET OBJECTS value
> 			  FROM OBJECTS 0x4ee380430) obj
> WHERE obj.@clazz.@name = "org.apache.hadoop.hbase.util.Counter$IndexHolder"
> #=> 2052 instances
> {code}
> Although as described in HBASE-16616 this somewhat seems to be an issue in G1GC side
regarding weakly-reachable objects, we should keep ThreadLocal usage minimal and avoid creating
an indefinite number (in this case, a number of HFiles) of ThreadLocal instances.
> HBASE-16146 removes ThreadLocals from the RPC metrics code.  That may solve the issue
(I just saw the patch, never tested it at all), but the {{HFileBlock$PrefetchedHeader}} are
still there in the ThreadLocalMap, which may cause issues in the future again.
> h5. Our Solution
> We simply removed the whole {{HFileBlock$PrefetchedHeader}} caching and fortunately we
didn't notice any performance degradation for our production workloads.
> Because the PrefetchedHeader caching uses ThreadLocal and because RPCs are handled randomly
in any of the handlers, small Get or small Scan RPCs do not benefit from the caching (See
HBASE-10676 and HBASE-11402 for the details).  Probably, we need to see how well reads are
saved by the caching for large Scan or Get RPCs and especially for compactions if we really
remove the caching. It's probably better if we can remove ThreadLocals without breaking the
current caching behavior.
> FWIW, I'm attaching the patch we applied. It's for CDH 5.4.5.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message