Questions tagged [pooling]

a container holds ready objects for clients, to reduce initialization time of expensive buffers or resources.

Commonly refers to network or database connection pools, or byte buffer pools.

239 questions
179
votes
9 answers

C# Object Pooling Pattern implementation

Does anyone have a good resource on implementing a shared object pool strategy for a limited resource in vein of Sql connection pooling? (ie would be implemented fully that it is thread safe). To follow up in regards to @Aaronaught request for…
Chris Marisic
  • 32,487
  • 24
  • 164
  • 258
42
votes
2 answers

Best practices for persistent database connections in Python when using Flask

My question is about the recommended approach for handling database connections when using Flask in a production environment or other environment where performance is a concern. In Flask, the g object is available for storing things, and open…
vincent31337
  • 982
  • 1
  • 8
  • 15
28
votes
5 answers

Why pool Stateless session beans?

Stateless beans in Java do not keep their state between two calls from the client. So in a nutshell we might consider them as objects with business methods. Each method takes parameters and return results. When the method is invoked some local…
20
votes
4 answers

Implementing Connection Pooling : Java

In one of the interviews that I faced,I was asked to implement connection pooling. So approach was this: Create a List or HashMap Create predefined number of connections Add them to the collection. Now when the ConnectionImpl getConnection() method…
crackerplace
  • 5,305
  • 8
  • 34
  • 42
15
votes
2 answers

Best Method of Channel Pooling in Google App Engine

It seems the only way to make the GAE Channel API financially viable is to implement some kind of pooling mechanism (one of the senior app engine product managers even told me this when I emailed them about the exorbitant price) to reuse channels…
Eternal Rubyist
  • 3,445
  • 4
  • 34
  • 51
14
votes
4 answers

Is DBCP (Apache Commons Database Connection Pooling) still relevant?

The JDBC 3.0 spec talks about Connection (and Prepared Statement) pooling. We have several standalone Java programs (i.e. we are not using an application server) that have been using DBCP to provide connection pooling. Should we continue to use…
jdigital
  • 11,926
  • 4
  • 34
  • 51
12
votes
2 answers

Why do we need connection pool in node.js when node is single threaded?

Node.js is single threaded. The Javascript V8 engine and some of the internal libraries are multi threaded. For I/O, node delegates I/O to OS which may be multi-threaded. If my node.js application is connecting to redis or ,sql/mariadb server, I…
Avneet
  • 123
  • 1
  • 4
12
votes
1 answer

npgsql Leaking Postgres DB Connections: Way to monitor connections?

Background: I'm moving my application from npgsql v1 to npgsql v2.0.9. After a few minutes of running my application, I get a System.Exception: Timeout while getting a connection from the pool. The web claims that this is due to leaking connections…
Alan
  • 45,915
  • 17
  • 113
  • 134
11
votes
5 answers

Running out of DB connections!

I'm running a Spring/Hibernate connecting to MySQL setup using c3p0 as my connection pool. For some bizarre reason it runs out of connections when the system is under load (of course). The site was pretty stable until we started hitting a new level…
matsientst
  • 620
  • 1
  • 9
  • 25
11
votes
1 answer

Tomcat Connection Pool Exhausted

I'm using Apache Tomcat JDBC connection pooling in my project. I'm confused because under heavy load I keep seeing the following error: 12:26:36,410 ERROR [] (http-/XX.XXX.XXX.X:XXXXX-X) org.apache.tomcat.jdbc.pool.PoolExhaustedException:…
Dal
  • 113
  • 1
  • 1
  • 4
10
votes
1 answer

tomcat 7.0.42 pooling, hibernate 4.2, mysql rock solid autoreconnect solution

i've read a lot of posts regarding problems with auto reconnecting to mysql from hibernate session. Others mention an increase of mysql wait_timeout (not my favorite), using autoReconnect=true (not recommended), testing connection e.t.c. I am…
sygram
  • 105
  • 1
  • 3
9
votes
2 answers

Thread Pool vs Many Individual Threads

I'm in the middle of a problem where I am unable decide which solution to take. The problem is a bit unique. Lets put it this way, i am receiving data from the network continuously (2 to 4 times per second). Now each data belongs to a different,…
h.i
  • 515
  • 1
  • 5
  • 16
8
votes
4 answers

Mean or max pooling with masking support in Keras

... print('Build model...') model = Sequential() model.add(Embedding(max_features, 128)) model.add(LSTM(size, return_sequences=True, dropout_W=0.2 dropout_U=0.2))…
Ersin
  • 151
  • 1
  • 2
  • 5
8
votes
2 answers

What is Apache Commons Pool close() behaviour

I've been looking to implement pooling in part of my application. I want to use the Commons Pool library but am slightly concerned about how the close() behaviour works. From looking at the javadocs and source code, it doesn't seem clear whether…
DrewEaster
  • 3,316
  • 3
  • 35
  • 39
7
votes
1 answer

Why allocation on ArrayPool is faster then allocation on Stack?

I have following benchmark which read string from file using Stack allocation, Heap allocation and ArrayPool allocation. I would expect that Stack allocation is fastest, because it is just stack pointer increment, but according to benchmark…
Tomas Kubes
  • 23,880
  • 18
  • 111
  • 148
1
2 3
15 16