IBM Support

IPV6 Can Cause Poor Java Performance

Troubleshooting


Problem

If the entire network is not IPv6-enabled or capable, users might find that Java programs perform poorly.

Resolving The Problem

This document explains that if the entire network is not IPv6-enabled or capable, users might find that Java programs perform poorly.

On IBM i 6.1 and later, the default JVM is the IBM Technology for Java™ (J9). This JVM runs in the PASE environment. When IPv6 is enabled (which is the default), each DNS entry is checked to see whether it is IPv6-capable. When PASE hits a slow or unresponsive DNS entry, it will wait for a reply or timeout. A Java thread dump (Javacore) will confirm that IPv6 is the source of the poor performance. The stack will show "Inet6AddressImpl" as follows:

...
at java/net/Inet6AddressImpl.lookupAllHostAddr(Native Method)
at java/net/InetAddress$2.lookupAllHostAddr(InetAddress.java:949)
at java/net/InetAddress.getAddressFromNameService(InetAddress.java:1318)
at java/net/InetAddress.getLocalHost(InetAddress.java:1505)

...

Resolution:

Disable IPv6 at JVM invocation by using the following Java properties:

o -Dcom.ibm.cacheLocalHost=true
o -Djava.net.preferIPv4Stack=true
o -Djava.net.preferIPv6Addresses=false


Note: These properties can be passed as command line arguments or added to a SystemDefault.properties file by performing the following steps:

1) On the IBM i command line type STRQSH

2) In Qshell paste the following lines, pressing ENTER after each:

touch -C 1252 /qibm/userdata/java400/systemdefault.properties

echo com.ibm.cacheLocalHost=true >> /qibm/userdata/java400/systemdefault.properties

echo java.net.preferIPv4Stack=true >> /qibm/userdata/java400/systemdefault.properties

echo java.net.preferIPv6Addresses=false >> /qibm/userdata/java400/systemdefault.properties


3) F3 to exit Qshell


If the JVM is a WebSphere Application Server job, use caution when adding these properties. Review the following technote to fully understand how these properties might adversely affect your application server environment.

http://www-01.ibm.com/support/docview.wss?uid=swg21498126

If you decide to add the properties to your server, they can be added as generic JVM arguments as shown down. The following graphic shows the properties set in WebSphere Application Server 7.0 Express:
This picture shows the Java properties added to the generic JVM arguments for the  WebSphere Application Server.

[{"Type":"MASTER","Line of Business":{"code":"LOB08","label":"Cognitive Systems"},"Business Unit":{"code":"BU054","label":"Systems w\/TPS"},"Product":{"code":"SWG60","label":"IBM i"},"Platform":[{"code":"PF012","label":"IBM i"}],"Version":"7.1.0"}]

Historical Number

609965164

Document Information

Modified date:
18 December 2019

UID

nas8N1011363