Thursday, 3 May 2012

WebSphere Application Server and DNS Caching

Earlier today, I was having a discussion about DNS caching in WebSphere Application Server, during my presentation - Desktop Single Sign-On in an Active Directory World - to the DanNotes conference here in Denmark.

I'd stated, in error, that WAS caches IP addresses that it retrieves from DNS. Whilst this WAS the case in the past, things have changed with Java 1.4.1 as per this Technote: -


Starting with Java™ 1.4.1, the IP address is not cached by default. This can cause delays and performance degradation if the application relies on this caching mechanism, since a lookup is now performed each time.

The WebSphere Application Server runtime code calls the InetAddress.getLocalHost() method in several places which then causes the DNS lookup requests. Applications making outbound calls would also trigger DNS lookup requests

There is, of course, a solution to this IF it becomes a problem.

There is a JVM setting - com.ibm.cacheLocalHost=true - that can be set, and the Technote shows how to set it for Deployment Manager, Node Agent, server instances etc.

Of course, one would always do this via a script :-)

This Technote - High DNS traffic or slow performance on WebSphere Application Server for z/OS v5.1 and higher - even provides a Python script here to set the parameter for you :-)

PS There's a related setting to "force" WAS to prefer IP v4 rather than v6 - java.net.preferIPv4Stack=true - we've made use of that on my current project.


No comments:

Note to self - use kubectl to query images in a pod or deployment

In both cases, we use JSON ... For a deployment, we can do this: - kubectl get deployment foobar --namespace snafu --output jsonpath="{...