Re: servlets slow when disconnected

From: Chris Smith (cdsmith_at_twu.net)
Date: 04/26/04


Date: Mon, 26 Apr 2004 07:52:47 -0600

Bura Tino wrote:
> I must begin by admitting that I pick things up as I need them (which is
> probably not the best approach, but to me that's life). So even though I've
> been writing servlet applications for a couple years now, I'm not quite sure
> what the word container means in the context of servlets and not quite sure
> what it means that it's logging the hostname of the client. Can you direct
> me a source so I can educate myself? (And maybe you can just tell me how to
> disable hostname logging...)

The container is the software that actually accepts connections from the
networks and calls your servlets. Examples include Tomcat, JRun, Caucho
Resin, Jetty, and more. J2EE application servers such as WebLogic,
WebSphere, or Sun ONE App Server also contain a servlet container as a
component of the larger system. Do you know which container you are
using?

The rest of your questions depend on which container you're using.
Depending on which one you're using, I may or may not be able to answer
it.

> As far as DNS, and I apologize if this is becoming increasingly ot, how come
> a disabled connection times out faster than a "media disconnected"-type
> connection.

A disabled connection doesn't exist as far as TCP/IP is concerned, so it
won't even try the connection. (Indeed, it couldn't.) If you've got a
cable unplugged, then the link exists, but just times out. That's the
difference.

> Also, what's so difficult about resolving "localhost"?

This depends on your network situation. Chances are, what's being
resolved is your external IP on the network interface of the client.

> And what makes me very curious is why dumb things like outlook and
> explorer time out instanteneously and the servlet container takes 15
> seconds (and does it twice)?

Simple. Outlook and IE aren't doing DNS lookups on your client IP
address. DNS behaves notoriously poorly when it can't find an answer
and it thinks it can find an answer from some server that's not really
available.

The delay happening twice (i.e., before and after the request is
handled) is likely due to the specific logging configuration in your
servlet container.

-- 
www.designacourse.com
The Easiest Way to Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation


Relevant Pages

  • Re: DriverManager vs. DataSource?
    ... > class to establish the connection. ... it is possible to use the DriverManager interface. ... JDBC driver jars go in a 'common' directory in the container. ... > the DataSource interface will typically be registered with a JNDI ...
    (comp.lang.java.databases)
  • Re: Strange Repadmin objects
    ... Open the ADSI Edit MMC snap-in. ... In the Connection Settings dialog box, in the Name field, enter a name for the ADSI connection. ... Right-click the object or container, click Delete, and then click Yes. ... This posting is provided "AS IS" with no warranties, ...
    (microsoft.public.windows.server.active_directory)
  • Re: Migrate Distribution Lists from 5.5 to 2003
    ... >Did you use the ADCTools to set up your connection ... They all reside in the Recipient container. ... I am logged in as the Exchange 5.5 system account. ... >Exchange Recipient Container include the Distribution ...
    (microsoft.public.exchange.setup)
  • Re: Struts: Data exchange between different applications
    ... > With or without Struts, ... Not exactly - there is no common context for whole servlet container ...
    (comp.lang.java.programmer)
  • Re: Serve static content with tomcat using a servlet on the front page
    ... goes, a servlet container is free to use a pool of instances, and it is also free to discard any particular instance at any time. ... It is possible that particular containers would allow you to configure these things in some container-specific way, and it is also possible that you could come up with a webapp configuration that caused your container of choice to use only one instance, but these are not good solutions. ...
    (comp.lang.java.programmer)