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 EB18F200BFB for ; Wed, 11 Jan 2017 09:34:59 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id E9B23160B4E; Wed, 11 Jan 2017 08:34:59 +0000 (UTC) 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 66709160B2E for ; Wed, 11 Jan 2017 09:34:59 +0100 (CET) Received: (qmail 94464 invoked by uid 500); 11 Jan 2017 08:34:58 -0000 Mailing-List: contact dev-help@zookeeper.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@zookeeper.apache.org Delivered-To: mailing list dev@zookeeper.apache.org Received: (qmail 94452 invoked by uid 99); 11 Jan 2017 08:34:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 11 Jan 2017 08:34:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 63C3D2C03DD for ; Wed, 11 Jan 2017 08:34:58 +0000 (UTC) Date: Wed, 11 Jan 2017 08:34:58 +0000 (UTC) From: "Yaohui Wu (JIRA)" To: dev@zookeeper.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (ZOOKEEPER-2661) It costs about 5055 ms to create Zookeeper object for the first time. MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 11 Jan 2017 08:35:00 -0000 [ https://issues.apache.org/jira/browse/ZOOKEEPER-2661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15817664#comment-15817664 ] Yaohui Wu commented on ZOOKEEPER-2661: -------------------------------------- It seems that the call InetAddress.getLocalHost() at line 62 is slow. code from class org.apache.zookeeper.Environment at line 56~65: public static List list() { ArrayList l = new ArrayList(); put(l, "zookeeper.version", Version.getFullVersion()); try { put(l, "host.name",//line 61 InetAddress.getLocalHost().getCanonicalHostName());//line 62 } catch (UnknownHostException e) { put(l, "host.name", ""); } > It costs about 5055 ms to create Zookeeper object for the first time. > --------------------------------------------------------------------- > > Key: ZOOKEEPER-2661 > URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2661 > Project: ZooKeeper > Issue Type: Bug > Components: java client > Affects Versions: 3.4.6 > Environment: See the description below. > Reporter: Yaohui Wu > Attachments: ZookeeperTest.java, log_output.txt > > > I create and close ZooKeeper for 10 times. It costs about 5055 ms for the first time. > See attached files for some test code and output. -- This message was sent by Atlassian JIRA (v6.3.4#6332)