IBM Support

Slow performance or hang in HostName lookup

Troubleshooting


Problem

There is slow performance or a hang during HostName lookup.

Symptom

Thread dumps or javacore files taken during the time of the slow response, or "hang threads" will show threads with the following lines at the top of the stack:

at java.net.Inet6AddressImpl.getLocalHostName(Native Method)
at java.net.InetAddress.getLocalHost(InetAddress.java:123)

 

Cause

The problem could be lookup issues between IPv6 versus IPv4. If the Domain Name System (DNS) server is not configured to handle IPv6 queries, the application may have to wait for the IPv6 query to time out for IPv6 queries.


These threads are waiting for a response for an IPv6 query. It is likely the DNS server is not responding to the IPv6 query.
 

Resolving The Problem

  • If your environment only uses IPv4, set the following argument for each process:

    -Djava.net.preferIPv4Stack=true

    This will disable IPv6 lookup requests and only use IPv4.
     
    • To set this in the WebSphere Application Server, do the following:
      1. Open the administrative console and navigate to:

        Servers > Application Servers > server_name > Process Definition > Java Virtual Machine > Custom Properties(/Environment Entries)
         
      2. Add the following name and value pair:

        Name: java.net.preferIPv4Stack
        Value: true
         
      3. Click Apply, then save all changes.
         
      4. Restart the application server.
         
    • To set this in WebSphere Liberty, do the following:
      1. In the same directory as your server.xml, look for a file called jvm.options
         
      2. If the jvm.options file does not exist in the directory, create it
         
      3. Add the following option to the jvm.options file:

        -Djava.net.preferIPv4Stack=true
  • If your environment uses IPv6, please have your network administrator check the DNS setup to ensure that it can respond properly to IPv6 queries.

[{"Product":{"code":"SSEQTP","label":"WebSphere Application Server"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Component":"Java SDK","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.0;8.5.5;8.5;8.0;7.0","Edition":"Base;Express;Network Deployment","Line of Business":{"code":"LOB45","label":"Automation"}},{"Type":"MASTER","Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSD28V","label":"WebSphere Application Server Liberty Core"},"ARM Category":[{"code":"a8m3p000000F7ylAAC","label":"IBM WebSphere Liberty-All Platforms-\u003EHang Performance CPU"}],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"All Versions"}]

Document Information

Modified date:
23 January 2023

UID

swg21170467