Questions tagged [connection-pooling]

In software engineering, a connection pool is a cache of connections maintained so that the connections can be reused when future requests to the resource are required.

Description

Connection pools are used to enhance the performance of executing commands on a database or other server. Opening and maintaining a connection for each user especially requests made to a dynamic database-driven website application, is costly and wastes resources.

In connection pooling, after a connection is created, it is placed in the pool and it is used over again so that a new connection does not have to be established. If all the connections are being used, a new connection is made and is added to the pool. Connection pooling also cuts down on the amount of time a user must wait to establish a connection to the resource.


Connection Pool libraries

Java

  • HikariCP
    It is considered as one of the best libraries for connection pooling. Play 2.4 Framework uses HikariCP by default.
    Website, GitHub.

  • BoneCP
    It beats older connection pools such as C3P0 and DBCP but should now be considered deprecated in favour of HikariCP.
    Website, GitHub

  • Apache Commons DBCP
    Website.

  • C3P0
    Website, GitHub

3263 questions
1
vote
2 answers

ASP.net Timeouts due to connections not being closed

Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all pooled connections were in use and max pool size was reached. This is the first ASP.net site I developed a long time ago,…
Tom Gullen
  • 61,249
  • 84
  • 283
  • 456
1
vote
0 answers

Cosmos Graph DB: How to resolve ConnectionPoolBusyException

I am using .Net Gremlin SDK(Gremlin.Net 3.4.8) to query Cosmos DB. Very often I am getting error ConnectionPoolBusyException: All 1 connections have reached their MaxInProcessPerConnection limit of 1. Consider increasing either the PoolSize or the…
1
vote
1 answer

Reactive Mongo: Max number of operations (maxQueueWaitSize) of 500 has been exceeded

I am using ReactiveMongoTemplate MongoDB ChangeStream to listen to updates to a MongoDB collection, perform some queries, and persist a document to another collection. While it had been working fine locally, It started giving the below error after…
1
vote
1 answer

Configure MongoDB connection pooling in Spring Boot application

I am trying to connect to a MongoDB replica set through a Spring Boot application with read preference secondary. I want to configure idle static connections only to secondary instance that get created automatically on application startup. I am…
Chirag
  • 11
  • 2
1
vote
1 answer

grpc client python: How to create grpc client connection pool for better throughput?

Our usecase is to make a large number of requests. Each request return 1 MB of data. Right now, on client side, we create a single GRPC channel and the run the following function in a loop content_grpc_channel =…
1
vote
1 answer

Problems using db2 type 4 drivers with glassfish

I am trying to create a connection pool for a db2 database in glassfish and I'm somewhat new to the entire process. I created the pool yesterday with no problems, I pinged the server successfully and all was well. The next time I start glassfish, my…
Joel Koroniak
  • 63
  • 1
  • 6
1
vote
0 answers

Why do HTTP connections in a pool become stale? And are there guidelines on how can I calculate an eviction policy?

I'm a beginner to request/response service programming using apache HTTP clients and am trying to understand how a client with a connection pool to a server might have some connections go stale in that pool. Here's what I currently…
gurdingering
  • 207
  • 5
  • 12
1
vote
0 answers

Connection pool for database has been unable to grant a connection

I have an Android application with a background service running all the time in the background. When the phone is unlocked, the background service is creating a database. When the phone is locked again, the database is closed. The problem now is…
machinery
  • 5,972
  • 12
  • 67
  • 118
1
vote
3 answers

Spring book 2 Hikari connection not available when concurrent api calls more than 10000 in aws

I am using spring boot 2 for APIs, hosted on aws ecs fargate. and database is postgress 10.6 on RDS with 16 gb ram and 4 cpu. my hikari configuration is as follows: spring.datasource.testWhileIdle = true spring.datasource.validationQuery = SELECT…
Mihir Shah
  • 1,799
  • 3
  • 29
  • 49
1
vote
0 answers

Using SQLAlchemy Connection Pooling Queues with Python multiprocessing

The SQLAlchemy documentation "How do I use engines / connections / sessions with Python multiprocessing, or os.fork()?" does not consider using connection pooling queues with multiprocessing. The example given does not specify a Queue using a…
1
vote
0 answers

How do you implement in PHP of using LDAP Pool Connection after we set the connection properties in apache ldap.conf?

I'm new to PHP, was interested in apache LDAP connection pool topic : LDAP Pool I've found several example but mostly written in Java. Is there a sample PHP code that I can refer to, such as documentation for PHP of implementing LDAP connection…
Azim
  • 11
  • 1
1
vote
1 answer

Way to convert *grpcpool.ClientConn to *grpc.ClientConn

I am working in golang for the first time and am trying to convert a variable of type *grpcpool.ClientConn to *grpc.ClientConn. I would like to pass the variable to a function that only takes *grpc.ClientConn. I am using a grpc client stub which…
1
vote
0 answers

Rust TCP Socket Pooling

I'm writing a client library for a custom TCP-based protocol. I'd like the library to easily permit users to make requests on multiple threads, which is the reason for my question. My library is intended to replace a slow, Python-based…
Jack
  • 396
  • 2
  • 18
1
vote
1 answer

Connections not reused with Jersey, ApacheConnectorProvider and PoolingHttpClientConnectionManager

We're using Jersey with ApacheConnectorProvider and PoolingHttpClientConnectionManager for pooled connections management. ClientConfig clientConfig = new ClientConfig(); clientConfig.property(ClientProperties.CONNECT_TIMEOUT,…
1
vote
0 answers

Guard Against Database Context Change For SQL Connection Pool

I have a collection of scripts that are being ran against a MSSQL database, some of these scripts set the database context to a different database other than what is used on initialization of the connection pool, other scripts expect the context to…