Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id C1FAF200ACC for ; Mon, 2 May 2016 12:47:14 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C09CD1609B1; Mon, 2 May 2016 12:47:14 +0200 (CEST) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 1BA141609A1 for ; Mon, 2 May 2016 12:47:13 +0200 (CEST) Received: (qmail 90847 invoked by uid 500); 2 May 2016 10:47:13 -0000 Mailing-List: contact issues-help@hbase.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Delivered-To: mailing list issues@hbase.apache.org Received: (qmail 90822 invoked by uid 99); 2 May 2016 10:47:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 May 2016 10:47:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id F12AD2C1F61 for ; Mon, 2 May 2016 10:47:12 +0000 (UTC) Date: Mon, 2 May 2016 10:47:12 +0000 (UTC) From: "Phil Yang (JIRA)" To: issues@hbase.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (HBASE-15742) Reduce allocation of objects in metrics MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 02 May 2016 10:47:14 -0000 [ https://issues.apache.org/jira/browse/HBASE-15742?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Phil Yang updated HBASE-15742: ------------------------------ Attachment: HBASE-15742-v2.patch Fix checkstyle warnings. I think the cache ttl need not be configurable, it a simple logic to prevent keeping useless objects too long. > Reduce allocation of objects in metrics > --------------------------------------- > > Key: HBASE-15742 > URL: https://issues.apache.org/jira/browse/HBASE-15742 > Project: HBase > Issue Type: Bug > Affects Versions: 1.3.0, 1.2.1, 1.0.3, 1.1.4, 0.98.19 > Reporter: Phil Yang > Assignee: Phil Yang > Fix For: 2.0.0, 1.3.0, 1.0.4, 1.4.0, 1.2.2, 0.98.20, 1.1.6 > > Attachments: HBASE-15742-v1.patch, HBASE-15742-v2.patch > > > We use JMX and o.a.h.metrics2 to do some metrics on regions, tables, region servers and cluster. We use MetricsInfo to show the information of metrics, and we use Interns to cache MetricsInfo objects because it won't be changed. > However, in Interns there are some static values to limit the max cached objects. We can only cache 2010 metrics, but we have dozens of metrics for one region and we have some RS-level metrics in each RS and all metrics for all regions will be saved in master. So each server will have thousands of metrics, and we can not cache most of them. When we collect metrics by JMX, we will create many objects which can be avoid. It increases the pressure of GC and JMX has some caching logic so the objects can not be removed immediately which increases the pressure more. > Interns is in Hadoop project, and I think the implementation is not suitable for HBase. Because we can not know how many MetricsInfo we have, it depends on the number of regions. And we can not set it unlimited because we should remove the objects whose region is split, moved, or dropped. I think we can use Guava's cache with expireAfterAccess which is very simple and convenient. > So we can add a new Interns class in HBase project first, and put it to upstream later. > Moreover, in MutableHistogram#snapshot we create same Strings each time, we can create them only in the first time. -- This message was sent by Atlassian JIRA (v6.3.4#6332)