On 07.07.2010 18:03, mmg wrote:

Hi Rainer,

Thanks for that suggestion, but it's not my code that's calling the method:
it's the icefaces framework so it's out of my control.

If you don't find a good other solution, you can write a simple filter, that registers a ServletRequestWrapper, so all calls to getLocalName() go through your wrapper which can then do something more suited to your needs instead of simply calling super.getLocalName().

To add the filter you have to add the new classes to the webapp and add the filter configuration to web.xml of the webapp, but you don't have to change any existing code or similar of the webapp.

Regards,

Rainer

Rainer Jung-3 wrote:

On 07.07.2010 16:08, mmg wrote:

Hello,

I've recently deployed an application on our Linux staging server; a
Tomcat
5.5.28 server on Java 1.5.0_09-b01. At some point, the application makes
a
call to request.getLocalName(). For some reason, this call takes a very
long
time (about 20 seconds!). I profiled the application, and I see that
tomcat
calls InetAddress.getHostName() in turn. This performs a reverse DNS
lookup.
It's this reverse DNS lookup that takes so long (since our host doesn't
have
a DNS address the resolve fails).

Is there a way to disable this reverse DNS lookup in Tomcat or is there
anything else I can do to speed this up?

You might want to try getLocalAddr (if IP is enough) or getServerName()
(if a host header is set by the client and that header is fine).

Regards,

Rainer

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org





--
kippdata
informationstechnologie GmbH   Tel: 0228 98549 -0
Bornheimer Str. 33a            Fax: 0228 98549 -50
53111 Bonn                     www.kippdata.de

HRB 8018 Amtsgericht Bonn / USt.-IdNr. DE 196 457 417
Geschäftsführer: Dr. Thomas Höfer, Rainer Jung, Sven Maurmann
===============================
kippdata
informationstechnologie GmbH   Tel: +49 228 98549 -0
Bornheimer Str. 33a            Fax: +49 228 98549 -50
D-53111 Bonn                   www.kippdata.de

HRB 8018 Amtsgericht Bonn / USt.-IdNr. DE 196 457 417
Geschäftsführer: Dr. Thomas Höfer, Rainer Jung, Sven Maurmann


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to