[
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<Entry> list() {
ArrayList<Entry> l = new ArrayList<Entry>();
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", "<NA>");
}
> 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)