My environment:  

Geronimo 2.1.4 (OpenEJB 3.0.1) on Windows.  Using OpenEJB Client in a java
app to make remote calls to stateless EJBs.

This issue still exists in OpenEJB 3.1.2.

Problem: 

If the server is unable to reverse lookup the ip address of a connecting
client, every remote EJB method call incurs a delay of multiple seconds
(while the lookup times out).

Findings: 

I tracked the problem down to ServiceLogger.java, line 68, where 'client' is
an InetAddress object,

org.apache.log4j.MDC.put("HOST", client.getHostName());

If I change this line to,

org.apache.log4j.MDC.put("HOST", client.getHostAddress());

then OpenEJB server does not perform a reverse lookup on every remote client
connection, which is much better.  It's only used for logging, and the IP
address should be sufficient for that.

To make things even worse, the OpenEJB client opens a new socket to the
server for every method call.  Every call takes a few seconds and my
application becomes unusable.

The easy answer might be, "Fix your DNS", but that's not a realistic option
for my customers who have distributed networks, DHCP, VPN clients, etc etc. 
Adding entries in the server machine's hosts file also 'fixes' the problem,
but not a good solution.

This is likely more of a problem on Windows than Linux/Unix since Windows
reverts to Netbios/WINS and network broadcasts when DNS doesn't return a
result.

Thanks All.
-- 
View this message in context: 
http://old.nabble.com/OpenEJB-Server---reverse-lookup-for-logging-causes-poor-performance-tp26916955p26916955.html
Sent from the OpenEJB User mailing list archive at Nabble.com.

Reply via email to