1

Is it possible to grow and shrink the pools dynamically. I would like to be able to grow the pool should it be needed and then shrink it down again when load is less all without restarting the application.

I tried setting the max connections variable, but it then simply defaults to 9 connections.

likenoother
  • 429
  • 1
  • 3
  • 11

1 Answers1

2

You can reduce or increase the "acquireIncrement" that "When the available connections are about to run out, BoneCP will dynamically create new ones in batches."

The default for BoneCP is 10. If for example you set "acquireIncrement" to 1 your pool will increase or decrease dynamically by 1, having always a number of connections corresponding to the value of minConnectionsPerPartition.

http://jolbox.com/index.html?page=http://jolbox.com/configuration.html

André Ricardo
  • 3,051
  • 7
  • 23
  • 32
  • The strange thing is that as soon as I set the max and min connections it seems to resize the pool to 10 connections and won't resize them to the size given. If for instance I increase it from 30 to 40 it will get reset to 10. Nothing I do can then increase it. Not sure if this is a bug. Using the latest version. – likenoother Oct 10 '12 at 14:50
  • Can you print out the BoneCPConfig `config.getMinConnectionsPerPartition();` and `config.getMaxConnectionsPerPartition();` to check BoneCP is picking up the correct values? – André Ricardo Oct 10 '12 at 15:00
  • Likely you have the poolThreshhold feature kicking in, default was set to 20% prior to v0.8.0-beta1 - check out the config. – wwadge Nov 01 '12 at 09:49
  • I don't see bonecp ever reducing the number of connections in the pool. If you get a spike it maxes out, but then even after traffic drops (or everything is cached as in my case) then it just leaves the max connections open.... Not sure why. – Kevin M May 21 '14 at 14:35