On 3/24/2018 3:34 PM, Christopher Schultz wrote:
Before we go too far, you have said:

1. You have 5 prod servers
2. They have several pools defined
3. The above is an example of a defined pool

Just above, that configuration says maxActive=60. 5 * 60 = 300
connections. And that's just for one pool.

Perhaps you simply have too many total connections when you add-up all
the possible connections your servers can make to your db server?

I'm aware of that, and the pool sizes probably are too big, but based on what I see when I look during the problem, I don't think it's what I need to be worried about right now.  If everything were working the way I would expect, each server would only need maybe a dozen connections at any given moment for ALL the pools, because connections would be re-used and new ones would not be needed.

Here's a couple of SQL queries showing the current connection state on the main server right now (on Saturday, a very low traffic period):

https://paste.apache.org/yTNp

This is slightly redacted.  I did the redaction so that the columns weren't broken.  There are 414 connections right now, which you can see from the second query.  Only four of them are not in the Sleep state, which you can see from the first query. Two of those four are slave servers, one of them is the event scheduler daemon, and one of them is the query I'm running right at that moment.  Which means that NONE of the webservers was doing anything on the database when I ran those queries.

The two webservers running Liferay 6.2 are fourqueens and fitzgeralds.  The three running Liferay 6.1 and the legacy application are fremont, frontier, and fiesta.  (Yes, they are casino names.  We inherited the system with that naming convention, and we have continued it.)

When we reach 600 connections, maybe 5 of the connections are actually doing something.  The rest are showing "Sleep", many with large idle times.  Which is why I think each server should have maybe a dozen total connections open.  Unless the code is opening connections and not closing them.  For that, I'm trying to get the developers to fix the code, and also configure abandoned connection removal, so the pool can clean up after bad development.

The databases with names that start with "lr" are liferay databases.  Those connections are using c3p0.  There are more connections active than I think SHOULD be there, but they all have VERY low idle times, so they ARE getting re-used.  I have plans for that config separate from what we're discussing here.

This is the Tomcat documentation I'm using as a reference:

https://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html
That's the wrong pool. You are using DBCP, and the docs are for
Tomcat's (non-DBCP) pool. The configurations are roughly the same for
simple configs. But make sure you are reading the right docs for the
right pool.

The factory we have now is "org.apache.tomcat.dbcp.dbcp.BasicDataSourceFactory".  The factory in the documentation, and what I put in the configuration I'm building, is "org.apache.tomcat.jdbc.pool.DataSourceFactory". These are both in the tomcat package space.  Yet you're telling me that I'm not using the Tomcat pool.  How is anybody supposed to come to that conclusion on their own?

If the attributes on that page cannot be used with "org.apache.tomcat.jdbc.pool.DataSourceFactory" ... then why are they included on a page that says to use that factory?

By the way, the 9.0 version of the docs still says virtually the same thing.  I found a historical document using Google for the 7.0.42 version we're running, and it ALSO has virtually the same information on it.

Since I can't rely on the documentation, can somebody please give me a configuration that will do what I'm trying to do?  And explain each difference from the config that I built, or point me to documentation that's complete enough for me to figure it out on my own?

Thanks,
Shawn


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

Reply via email to