Dynamo uses a resource pool of JDBC connections to minimize the need to create new connections each time you access the database. A Dynamo resource pool lets you configure the minimum and maximum size of the connection pool. For information about configuring resource pools in general and database connection pools in particular, see the Core Dynamo Services chapter in the ATG Programming Guide and the Configuring Databases and Database Access chapter in this book.

There is not a big performance penalty for making the pool too large. Startup time will be longer if you need to create many connections at startup. In addition, if the pool is larger than you need, you potentially waste sockets and database connections, which can be expensive for some database vendors.

The size of the database connection pool you need varies widely, depending on how much traffic your application handles and how frequently it needs to access the database. Ultimately, the only way to determine the optimum size of your database connection pool is to observe the application under load, both in predeployment testing and after deployment.

You can monitor the number of database connections checked out at any moment on the Dynamo Administration interface page for the connection pool. For the standard JTDataSource, this page is located at:

http://hostname:port/nucleus/atg/dynamo/service/jdbc/JTDataSource

The maxSimultaneousResourcesOut property of a connection pool tracks the largest number of resources that have ever been checked out of the resource pool at one time. You can examine this property during testing and after deployment to get an idea of the maximum number of resources your application requires. If the value of maxSimultaneousResourcesOut is significantly less than the value of max, you can probably reduce the size of your resource pool.

If you reach the limit of database connections checked out and the CPU or I/O of your database server is not at maximum utilization, you have set the maximum pool size too low. In this case, you could get better performance by adding database connections, since that will utilize more of the capacity of your database server.

Once you have estimated the optimal size of your connection pool, you can set the min property of the connection pool to equal the max value. This ensures that on startup, your pool can allocate all of the resources that it will potentially need.

 
loading table of contents...