Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9103183
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T01:34:27+00:00 2026-06-17T01:34:27+00:00

We are using DBCP inside a Grails application. The database is on another server,

  • 0

We are using DBCP inside a Grails application. The database is on another server, so TCP/IP is in play here. We have monitored the database by doing a show processlist frequently, and we never see above 50 connections. However, the sockets on the client grow enormously (at one point I saw over 2700). Most of them are in TIME_WAIT status.

So eventually we get a NoRouteToHostException, because it cannot open a socket.

Note that we hit the database over 40,000 times in less than a minute in this use case.

Does anyone have suggestions as to why this might be? I would think that, since our connection pool is limited to 100 (and we only see about 50 connections open), I’d only see slightly more than 50, since occasionally one might get stale. But we’re seeing thousands. Is this expected? Or any other tips about something we might be missing when looking at this situation?

Here are the dbcp settings we are using:

        properties {
            maxActive = 100
            maxIdle = 4
            minIdle = 1
            initialSize = 1
            minEvictableIdleTimeMillis = 60000
            timeBetweenEvictionRunsMillis = 60000
            maxWait = 10000
            removeAbandoned = true
            removeAbandonedTimeout = 60
            validationQuery = "/* PING */ SELECT 1"
            testOnBorrow = true
            testWhileIdle = true
            numTestsPerEvictionRun = -1
            logAbandoned = true
        }

Also note that we use autoReconnect=true on the connection string, although we are considering dropping it (we get stale connections overnight otherwise).

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T01:34:29+00:00Added an answer on June 17, 2026 at 1:34 am

    Ok, so I was able to sort it out. Turns out I was misunderstanding the maxIdle and how it works.

    Anything returned to the pool above maxIdle is immediately released. So most of the connections were being closed and reopened, hence why the sockets were exhausted.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Java web application connecting to an Oracle database running on another
We have a Spring application that uses Apache DBCP for connection pooling. Our app
Using java/Spring/Ibatis sqlserver is the database and datasource is org.apache.commons.dbcp.BasicDataSource following is the data
Using java/Spring/Ibatis sqlserver is the database and datasource is org.apache.commons.dbcp.BasicDataSource following is the source
We are using a j2ee application with spring framework 2.0. The server used is
greetings all i have a web application using (spring-hibernate) frameworks and when tried to
I want to use commons DBCP in my web application. I am using java
I'm using dbcp connection pooling in tomcat (version 7) and I have a connection
Suppose that I have an application using ibatis 2 and spring 1. I have
I'm trying to establish a connection to an Oracle database using BasicDataSource using DBCP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.