Hi Andre,

Thanks for your response.

My initial tests to localhost and then IP:port were in an attempt to
eliminate (or at least reduce the chance) of DNS lookups being a factor -- a
few years ago that beast had reared its head in relation to SSL, certificate
chains, and other fun stuff.  In this case SSL isn't entering into the
equation, but those lookups hadn't been forgotten, which is what brought me
to ask whether there's anything that could drive that sort of action in
Tomcat's default config that I might be able to disable.

To try to cut down on the number of variables, on the client machine I've
tested both with and without hosts file entries.

This morning I'm seeing slightly different behaviour, both with and without
hosts file entries:
- the same test previously mentioned with one of the servers typically
taking 17 seconds now either takes 12+/-1 second (like another of the
servers tested) or 42+/-1 second, without any middle ground...again, tomcat
and the db server don't break a sweat -- they have plenty of resources free
in the way of cpu/ram/throughput capacity

For the parts of the equation I'm aware of, if server-side lookups were a
factor wouldn't some form of significant delay be apparent when hitting
tomcat from another machine within the same vlan?  (Wouldn't it be normal
(in a typical case) for what's happening between tomcat and the db server to
remain the same, regardless of where the client tomcat's serving
resides?...That being said, Tomcat itself could be doing something related
to the client, or the client could be doing something in relation to the
server...client-side, I'd hoped that a host file entry would cover that
base...as far as Tomcat, though -- that's what I'm hoping to figure out ;)

In case something jumps out at you, here's what I find in server.xml,
slightly sanitized...please ask if there's anywhere else you'd like to look,
and thanks again for helping:

<?xml version='1.0' encoding='utf-8'?>
<Server port="8005" shutdown="SHUTDOWN">
  <Listener className="org.apache.catalina.core.AprLifecycleListener"
SSLEngine="on" />
  <Listener className="org.apache.catalina.core.JasperListener" />
  <Listener className="org.apache.catalina.mbeans.ServerLifecycleListener"
/>
  <Listener
className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
  <GlobalNamingResources>
    <Resource name="UserDatabase" auth="Container"
              type="org.apache.catalina.UserDatabase"
              description="User database that can be updated and saved"
              factory="org.apache.catalina.users.MemoryUserDatabaseFactory"
              pathname="conf/tomcat-users.xml" />
  </GlobalNamingResources>
  <Service name="Catalina">
    <Connector port="8754" protocol="HTTP/1.1"
               connectionTimeout="20000"
               redirectPort="8443" />
    <Connector port="8009" protocol="AJP/1.3" redirectPort="8443" />
    <Engine name="Catalina" defaultHost="localhost">
      <Realm className="org.apache.catalina.realm.UserDatabaseRealm"
             resourceName="UserDatabase"/>
            <Host name="localhost" appBase="webapps"
                  unpackWARs="true" autoDeploy="true"
                  xmlValidation="false" xmlNamespaceAware="false">
                <Context docBase="ROOT" path="" reloadable="false"
caseSensitive="false">
                    <Resource
                            name="jdbc/appropriateDB"
                            auth="Container"

factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
                            type="javax.sql.DataSource"

driverClassName="net.sourceforge.jtds.jdbc.Driver"

url="jdbc:jtds:sqlserver://servername;databaseName=correctDBName;instance=;useLOBs=false"
                            username="appropriate_name"
                            password="appropriate_pw"
                            maxActive="250"
                            maxIdle="30"
                            maxWait="10000"
                            removeAbandoned="true"
                            removeAbandonedTimeout="60"
                            logAbandoned="true"
                            poolPreparedStatements="true"
                            validationQuery="select 1"/>
                </Context>
                <Context path="/iimages"
docBase="\\servername\data\iimage<file://servername/data/iimage>"
reloadable="false" caseSensitive="false">
                </Context>
                <Context path="/audio"
docBase="\\servername\data\audio<file://servername/data/audio>"
reloadable="false" caseSensitive="false">
                </Context>
                <Context path="/custom"
docBase="\\servername\data\custom<file://servername/data/custom>"
reloadable="true" caseSensitive="false">
                </Context>
            </Host>
            <Host name="@host.ROOT_Training@" appBase="webapps"
                  unpackWARs="true" autoDeploy="true"
                  xmlValidation="false" xmlNamespaceAware="false">
                <Context docBase="ROOT_Training" path="" reloadable="false"
caseSensitive="false">
                    <Resource
                            name="jdbc/appropriateDB"
                            auth="Container"

factory="org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory"
                            type="javax.sql.DataSource"

driverClassName="net.sourceforge.jtds.jdbc.Driver"

url="jdbc:jtds:sqlserver://@database.url.ROOT_Training@
;databasena...@database.name.root_training@
;instan...@database.instance.root_training@;useLOBs=false"
                            username="@database.username.ROOT_Training@"
                            password="@database.password.ROOT_Training@"
                            maxActive="250"
                            maxIdle="30"
                            maxWait="10000"
                            removeAbandoned="true"
                            removeAbandonedTimeout="60"
                            logAbandoned="true"
                            poolPreparedStatements="true"
                            validationQuery="select 1"/>
                </Context>
                <Context path="/iimages"
docBase="@datastore.path.root_train...@\iimage" reloadable="false"
caseSensitive="false">
                </Context>
                <Context path="/audio"
docBase="@datastore.path.root_train...@\audio" reloadable="false"
caseSensitive="false">
                </Context>
                <Context path="/custom"
docBase="@datastore.path.root_train...@\custom" reloadable="true"
caseSensitive="false">
                </Context>
            </Host>
        </Engine>
    </Service>
</Server>







On Mon, Mar 29, 2010 at 9:54 AM, André Warnier <a...@ice-sa.com> wrote:


> Hi.
>
> Just a very preliminary guess : could it be that different DNS lookups are
> involved in the delays ? Obviously, "localhost" and IP addresses don't need
> them, but maybe some of the connections between Tomcat(s) and database
> server(s) are specified by name instead of IP, and/or use different DNS
> servers, or in a different order ?
>
>
> Ian Hubbard wrote:
>
>
>> Hi all,
>>
>> I've got Tomcat 6 running on a few separate internal dedicated test
>> machines in a data center, each with their own separate dedicated SQL
>> servers.
>>
>> The servers themselves don't bat an eye for the tiny load i'm subjecting
>> them to.  For testing (using IE 6 or 7) I've been performing the same
>> action, loading a simple page that uses simple queries (packet captures
>> indicate that total data transferred is in the 200KB range, start to
>> finish), with the following results:
>> - on the webservers themselves, going to localhost:8754, pages take less
>> than 1 second, all told
>> - from another server in the same subnet, to tomcat via IP address to
>> 8754,
>> 1-2 seconds...so far, what's generally seen as normal in other
>> environments
>> - from a system outside the data center (but still internal, using VPN
>> over
>> dual T1's), again by IP, pages will load in ~17 seconds consistently using
>> two of the servers in separate subnets, and 12 seconds consistently from a
>> third (each server stands alone in its respective environment, hiding in
>> its own little VLAN)
>>
>> The servers are configured similarly, as are the networks they live in.
>>  For
>> a similar setup to other data centers more geographically distant, I can
>> usually expect to see loading times of 3-5 seconds, as opposed to the
>> 12/17
>> seconds being seen in these cases.  If they were _all_ consistently 17
>> seconds, I'd be more inclined to point my finger firmly at the
>> network...that one server that's equivalent for all intents and purposes
>> completes the same task in 12, though, is a little strange.
>>
>> The network config side of things is beyond my direct control.  There are
>> likely things there that can be fine-tuned by request, if I can figure out
>> what recommendation to make, and have evidence to support the
>> recommendation.
>>
>> At this point, I'm particularly interested in whether there's anything
>> within my control to improve things.  The tomcat conf settings are fairly
>> vanilla -- are there any common things I should look at disabling or
>> changing which may improve things?  (Such as settings that could result in
>> lookups  and so on, which could slow things down notably even if they
>> aren't
>> immediately apparent, given that the servers aren't under any notable
>> load,
>> and so on.)
>>
>> I'll happily post settings that may be of interest...I haven't done so
>> just
>> yet, since I don't want to inundate you with irrelevant info.
>>
>> Thank you for taking the time to throw any ideas you may have my way!
>>
>> Cheers,
>> Ian
>>
>>
>>
>
>
>  ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>
>

Reply via email to