libzbxpgsql icon indicating copy to clipboard operation
libzbxpgsql copied to clipboard

Connection pooling

Open cavaliercoder opened this issue 8 years ago • 0 comments

Connection pooling is currently recommended via PG Bouncer/other (http://cavaliercoder.com/libzbxpgsql/documentation/connection-pooling/).

There is an opportunity however to reuse a single connection for each agent thread. This would mean that:

  • connection overhead is significantly reduced
  • server version information can be persisted between each query to simplify version switching of queries

We would need:

  • a hash of the connection so multiple connections can be monitored per thread
  • a way to query the state of a connection and reconnect if needed
  • to pass server information to each metric handler so it knows which version to query
  • reasonable timeouts
  • cleanup on exit

cavaliercoder avatar Jun 18 '17 12:06 cavaliercoder