Re: [dspace-tech] Google Analytics leads to connection pool exhausted?

69 views
Skip to first unread message

Sean Kalynuk

unread,
Jan 13, 2021, 1:13:02 PM1/13/21
to Gabriela M, DSpace Technical Support

Hi Gabriela,

 

Some options to try:

  1. See if the connection limit on the PostgreSQL side is too low. This could be system-wide, for the database, or even for the DSpace database user.
  2. Increase db.maxconnections in your DSpace configuration and restart Tomcat. My understanding though is that, without a global connection pool, this setting applies per webapp, so increasing it can run the risk of hitting the connection limit to the PostgreSQL database even faster since each webapp can now allocate up to db.maxconnections. However, you might find that increasing it alleviates your immediate problem. If you do increase it, make sure your database can handle the increased connections as per option 1.
  3. Configure a global connection pool for all of Tomcat to be shared by all DSpace webapps. There’s a discussion thread with details here.

 

Some other reference information:

 

https://wiki.lyrasis.org/display/DSDOC5x/Configuration+Reference#ConfigurationReference-DSpaceDatabaseConfiguration

 

https://tomcat.apache.org/tomcat-7.0-doc/jdbc-pool.html

 

Although it’s for DSpace 6.x, the install guide has a section called “External Database Connection Pool” here: https://wiki.lyrasis.org/display/DSDOC6x/Installing+DSpace#InstallingDSpace-Externaldatabaseconnectionpool

I don’t think the DSpace 5.x manual has this information.

 

--

Sean

 

From: dspac...@googlegroups.com <dspac...@googlegroups.com>
Date: Wednesday, January 13, 2021 at 11:05 AM
To: DSpace Technical Support <dspac...@googlegroups.com>
Subject: [dspace-tech] Google Analytics leads to connection pool exhausted?

Caution: This message was sent from outside the University of Manitoba.

I have been running DSpace 5.5 with Tomcat 7 and Postgresql 9 in production for more than five years. A few weeks ago, the site started displaying Internal Server Error. The errors were coming up quite often, every couple of hours or so, and were going away after a tomcat restart. The logs were showing "Cannot get a connection, pool error Timeout waiting for idle object". I enabled the DEBUG level for logging, and every time before the connection pool was exhausted, I noticed this in the logs:

 

2021-01-13 03:36:34,379 DEBUG org.dspace.google.GoogleRecorderEventListener @ Usage event received bitstream:view

2021-01-13 03:36:34,380 DEBUG org.apache.http.client.protocol.RequestAddCookies @ CookieSpec selected: best-match

2021-01-13 03:36:34,380 DEBUG org.apache.http.client.protocol.RequestAuthCache @ Auth cache not set in the context

2021-01-13 03:36:34,380 DEBUG org.apache.http.impl.conn.PoolingHttpClientConnectionManager @ Connection request: [route: {s}->https://www.google-analytics.com:443][total kept alive: 0; route allocated: 2 of 2; total allocated: 2 of 20]

2021-01-13 03:36:41,422 ERROR org.dspace.storage.rdbms.DatabaseManager @ SQL connection Error -

2021-01-13 03:36:41,423 WARN org.dspace.app.webui.servlet.DSpaceServlet @ anonymous:no_context:database_error:org.apache.commons.dbcp.SQLNestedException\colon; Cannot get a connection, pool error Timeout waiting for idle object

 

Any help would be much appreciated,

Gabriela

--
All messages to this mailing list should adhere to the DuraSpace Code of Conduct: https://duraspace.org/about/policies/code-of-conduct/
---
You received this message because you are subscribed to the Google Groups "DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dspace-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/dspace-tech/d654dc18-490b-41b8-8c0d-0a32a80de6e4n%40googlegroups.com.

Alex Fletcher

unread,
Jan 25, 2021, 9:45:44 AM1/25/21
to DSpace Technical Support
We had similar issues and when we implemented almost those exact same steps at the start of January, we began having SOLR errors (described in a similar email here: https://groups.google.com/g/dspace-tech/c/TxuYMITm2E8 )

Ultimately, we ended up having to disable the Google Analytics bean to fix the outages.

Alex
Reply all
Reply to author
Forward
0 new messages