rethink-scala icon indicating copy to clipboard operation
rethink-scala copied to clipboard

Shrink connection pool under low load

Open mick-h opened this issue 10 years ago • 2 comments

Load testing in a Play app showed that once the pool opens new connections to deal with the load, it does not close them when the load abates. To load test I used siege: siege -c 200 -t 3m http://localhost:10000/...

and to view open connections I use lsof: watch -n 5 "sudo lsof | grep rethink | grep 28015"

mick-h avatar Nov 06 '14 23:11 mick-h

What sort of features/configurable should this have?

kclay avatar Nov 22 '14 01:11 kclay

In terms of config, starting pool size, minimum pool size, maximum open connections. In terms of logic, begin with starting pool size connections open. As connections are borrowed, if the number of available connections drops below minimum pool size connections, start creating new ones, up until maximum open connections. When connections are returned to the pool, if the pool size is larger than starting pool size, close the connections. That would be my approach.

mick-h avatar Nov 23 '14 22:11 mick-h