|Title|DNS lookups taking too long
|Date|10-Jan-2005 12:19:15 EET
|Browser version|
|[PageProvider] used|
|Servlet Container|
|Operating System|
|Java version|

DNS lookups in the log statements can sometimes take far too long.  Original discussion below:


This may not be the appropriate place for this entry, I'm not sure where else to put it though...

My Wiki is running incredibly slow. I'm using the latest version of Tomcat3 on a PIII 900MHz with 512Mb of RAM. It is running another instance of Tomcat and another app but the CPU is idling most of the time - even when I am waiting for a Wiki page. The box is on the same network so I wouldn't expect bandwidth to be the issue.

Not sure what's causing this....

Exactly what is slow? Everything? If it's just things like [RecentChanges], consider using [CachingProvider].


Nope it's everything that's slow. I'm on the other side of the atlantic and your Wiki is about 5-8x faster responding to any request.


Very odd. Which OS are your running? I know the different *BSD -variants have sometimes real trouble with Java...


(Confirmation: we have a FreeBSD 4.5 server running Java 2 1.3x, and it's much slower than poor little ecyrd.com. This has something to do with the lack of a native JDK, and thus, decent threading. FreeBSD seems to use a linux Java port at this writing. --ebu)

Ecyrd.com is actually a 266 MHz Pentium II with 192 MB of memory, so it's not exactly a speed daemon either =). Matt - was your OS a *BSD variant?


Another note: This is probably due to the DNS lookups involved.


Not sure if this was featured in Tomcat 3, but in Tomcat 5 the Connectors (server.xml) have an option 'enableLookups' that can be set to true, default is false. This is documented in a comment in the standard server.xml (tomcat 5.0): {{{
    By default, DNS lookups are enabled when a web application calls
    request.getRemoteHost().  This can have an adverse impact on
    performance, so you can disable it by setting the
    "enableLookups" attribute to "false".  When DNS lookups are disabled,
    request.getRemoteHost() will return the String version of the
    IP address of the remote client.}}}


JSPWiki 2.2 should be using getRemoteAddr() instead of getRemoteHost() everywhere; therefore making DNS lookups not necessary.

-- JanneJalkanen