Question

Commons DBCP vs Tomcat JDBC Pool

Hi,

There was a pretty big change made in Tomcat as to JDBC connection pool facility. Tomcat has updated its default connection pooling library to Tomcat JDBC Pool ("tomcat-jdbc-pool") in Tomcat 8. Tomcat 7 and earlier version used Commons DBCP ("commons-dbcp"). For example, Tomcat JDBC Pool uses "maxTotal" instead of "maxActive" to limit the number of connections. In order to enable this new feature Tomcat JDBC Pool, you need to add factory attribute in your context.xml. In summary,

  1. If you are using Tomcat 7, you can use maxActive & maxWait.
  2. If you are using Tomcat 8, you should use maxTotal & maxWaitMillis.
  3. If you are using Tomcat 8, you should also add factory attribute as follows:
    factory="org.apache.tomcat.jdbc.pool.DataSourceFactor"

Question:

Is my understanding above correct? If yes, here is my proposal to installation guide creation team:

The guide should state above as a note because it is pretty important (if you misuse wrong parameters, for example misusing maxActive in Tomcat 8, then your setting will be ignored). Currently 7.4 installation guide talks about only maxActive instead of maxTotal, and 8.3 guide does not state the importance of factory attribute - I have already seen a couple of customers misusing incorrect parameters. I am suspecting that this confusion may even cause another severe error (https://community1.pega.com/community/pega-support/question/anyone-managed-successfully-install-82).

[7.4 installation guide]

Isn't this wrong?

[8.3 installation guide]

It will be better to write some explanation of the importance of factory attribute in Tomcat 8x or people may just copy old settings from prior version environment and forget it.

Let me know if my suggestion makes sense or not.

Thanks,

***Edited by Moderator: Lochan to update SR details***

Group Tags

Correct Answer
September 3, 2019 - 10:50am

Agreed completely! In fact, we have seen some system instability due to high load if not using tomcat connection pool. All Pegacloud environments use tomcat connection pool as well as it is the default setup for Pega container deployment. Suggest contact documentation team.

Comments

Keep up to date on this post and subscribe to comments

September 3, 2019 - 10:50am

Agreed completely! In fact, we have seen some system instability due to high load if not using tomcat connection pool. All Pegacloud environments use tomcat connection pool as well as it is the default setup for Pega container deployment. Suggest contact documentation team.

Pega
September 18, 2019 - 1:24am
Response to KevinZheng_GCS

Thanks Kevin, I raised an "SR-D43040: JDBC pool setting instruction is incorrect in installation guide" and it was acknowledged as a documentation bug. Support said it will be updated. Thank you for your help!

September 4, 2019 - 1:48pm

Kevin, 

1. I'm on 7.2.2 Tomcat 9.  Are aware of any issues/restrictions for using these new settings on that combination?

2. How can I monitor my connection pool to see if it is sized correctly?  I have not found any documentation to help me set up the pool based on the number of users, and processes.

Thanks

John