Re: Database connection causes slow startup

2011-11-17 Thread Ben Gladstone
Thanks for your help. I solved the problem. It turns out the problem was in
that fastConnectionFailover option. I disabled that, and it now starts up
in 46 seconds.

On Wed, Nov 16, 2011 at 2:23 PM, Christopher Schultz <
ch...@christopherschultz.net> wrote:

> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> Ben,
>
> On 11/16/11 2:44 PM, Ben Gladstone wrote:
> >  > type="oracle.jdbc.pool.OracleDataSource"
> > connectionCachingEnabled="true" description="FCF Datasource"
> > driverClassName="oracle.jdbc.OracleDriver"
> > factory="oracle.jdbc.pool.OracleDataSourceFactory"
> > fastConnectionFailoverEnabled="true" onsConfigStr="nodes=PRIVATE"
> >
> > implicitCachingEnabled="true"
> > connectionCacheProperties="(InitialLimit=10, MinLimit=10,
> > MaxLimit=150, ConnectionWaitTimeout=40,
> > AbandonedConnectionTimeout=40, TimeToLiveTimeout=90)"
> > connectionCacheName="portal_connection_pool" user="PRIVATE"
> > password="PRIVATE" url="jdbc:oracle:thin:@
> >
> (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=PRIVATE)(PORT=1521))(LOAD_BALANCE=yes)(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME=PRIVATE))"
> >
> >
> />
>
> Note that you are not using Tomcat's connection pooling: you are using
> Oracle's connection pooling because you specified the "factory"
> attribute and told Oracle to create DataSource objects for you.
>
> Try setting type="javax.sql.DataSource" and removing the "factory"
> attribute to use Tomcat's connection pool (which is commons-dbcp).
>
> If Tomcat takes 7 minutes to start up, that sounds like plenty of time
> to take a thread dump to see what's going on.
>
> - -chris
> -BEGIN PGP SIGNATURE-
> Version: GnuPG/MacGPG2 v2.0.17 (Darwin)
> Comment: GPGTools - http://gpgtools.org
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
>
> iEYEARECAAYFAk7EN+sACgkQ9CaO5/Lv0PBIKQCfXNOu9MyIbT4LTkXm2QxE4Vz3
> NO8AmwZgLbVKc8vHyKCsqvK1mhIp/GNC
> =FhEO
> -END PGP SIGNATURE-
>
> -
> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
> For additional commands, e-mail: users-h...@tomcat.apache.org
>
>


Re: Database connection causes slow startup

2011-11-16 Thread Ben Gladstone
If I'm not mistaken, the data sources are defined in server.xml.

Let's try this again. Here's server.xml:






  
  
  
  
  
  
  
  
  

  
  



  

   
  

  
  





















  
  

  
  

  
  

  
  







  

  









Here's context.xml:







WEB-INF/web.xml












And catalina.out is huge, but the last line is:
INFO: Server startup in 423933 ms



On Wed, Nov 16, 2011 at 11:24 AM, Daniel Mikusa  wrote:

>
> On Wed, 2011-11-16 at 11:07 -0800, Ben Gladstone wrote:
>
> >  I've attached my server.xml, context.xml, and catalina.out.
>
> I don't believe that you can attach files to the list.  You'll need to
> copy and paste the information in your email.
>
> > Now, it takes around 7 minutes to start.
>
> This seems long, but it really depends on how many connections you've
> configured the pool to initially make and how long it takes to make each
> connection.  Where are you defining your DataSources and what do the
> definitions look like?
>
> Dan
>
>
>


Database connection causes slow startup

2011-11-16 Thread Ben Gladstone
Hey all,

I'm running Tomcat 6.0.33, Java 1.6.0_29, and Ubuntu 11.10 64-bit (kernel
3.0.0-12). I'm using Tomcat to connect to 2 databases, defined in my
conf/server.xml file. Before I added these data sources, Tomcat started up
quickly. Now, it takes around 7 minutes to start. It still connects to the
databases, and once it's connected it runs quickly, but it takes quite a
while to connect. Am I doing something wrong? I've attached my server.xml,
context.xml, and catalina.out. Thanks for your help!

Ben

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