IBM Support

IPV6 Can Cause Poor Java Performance

Technote (troubleshooting)


Problem(Abstract)

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

Resolving the problem

This document explains that if the entire network is not IPv6-enabled or capable, users may 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 if 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 shown below:

...
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, hitting 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. You should review the following technote to fully understand
how these properties could 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 below. 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.

Cross reference information
Segment Product Component Platform Version Edition
Operating System IBM i 6.1
Operating System IBM i 7.1
Operating System IBM i 7.3
Operating System IBM i 7.2

Historical Number

609965164

Document information

More support for: IBM i
Java

Software version: 6.1.0, 6.1.1, 7.1, 7.2, 7.3

Operating system(s): IBM i

Reference #: N1011363

Modified date: 27 November 2012


Translate this page: