JMX/getHostByAddr

Discussion in 'Java' started by Skijor, Sep 19, 2010.

  1. Skijor

    Skijor Guest

    I ran into an issue where I have a Java JMX service running on a Linux
    host that is taking 23 seconds to establish a TCP connection with a
    client. I took a thread dump (see below) and discovered that the time
    is spent by java doing a reverse DNS look-up on the inbound connection
    attempt. We have disabled the NSCD (Name Service Cache Daemon) on our
    host so the DNS delay is understandable.

    Question: Why does java even care about resolving the hostname? JMX
    is built on top of TCP. TCP does not require DNS to establish
    connectivity so why does Java insist on obtaining a hostname for the
    client's IP on an inbound connection?

    at java.net.Inet4AddressImpl.getHostByAddr(Native Method) ????

    "Thread-5" prio=10 tid=0x00002aaacc084800 nid=0x74b5 runnable
    [0x0000000042ed7000]
    java.lang.Thread.State: RUNNABLE
    at java.net.Inet4AddressImpl.getHostByAddr(Native Method)
    at java.net.InetAddress$1.getHostByAddr(Unknown Source)
    at java.net.InetAddress.getHostFromNameService(Unknown Source)
    at java.net.InetAddress.getHostName(Unknown Source)
    at java.net.InetAddress.getHostName(Unknown Source)
    at
    com.sun.jmx.remote.socket.SocketConnection.<init>(SocketConnection.java:
    60)
    at
    com.sun.jmx.remote.socket.SocketConnectionServer.accept(SocketConnectionServer.java:
    173)
    at
    com.sun.jmx.remote.generic.SynchroMessageConnectionServerImpl.accept(SynchroMessageConnectionServerImpl.java:
    47)
    at javax.management.remote.generic.GenericConnectorServer
    $Receiver.run(GenericConnectorServer.java:334)
    Skijor, Sep 19, 2010
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Neil Aggarwal

    gethostbyaddr returning null for CNAME records

    Neil Aggarwal, Feb 25, 2004, in forum: C Programming
    Replies:
    2
    Views:
    3,830
    Ben Pfaff
    Feb 25, 2004
  2. Mohammed Smadi

    socket.gethostbyaddr problem

    Mohammed Smadi, Sep 18, 2005, in forum: Python
    Replies:
    1
    Views:
    593
    Irmen de Jong
    Sep 18, 2005
  3. Harlin Seritt

    socket.gethostbyaddr() question

    Harlin Seritt, Jan 15, 2006, in forum: Python
    Replies:
    2
    Views:
    2,076
    Steve Holden
    Jan 15, 2006
  4. gethostbyaddr/nslookup failed

    , Jul 27, 2005, in forum: C Programming
    Replies:
    1
    Views:
    545
    Artie Gold
    Jul 27, 2005
  5. mike
    Replies:
    0
    Views:
    340
Loading...

Share This Page