Control database connection pool

Hello,

Does anyone know how to set the settings for the database connection pool? From what I can tell, it’s using C3P0 so there should be a way to specify a max connection setting. Just don’t know how Metabase handles that kind of settings.

Metabase: fine software by the way - like the concept!

Are you trying to fix a problem or just curious? We don’t currently expose these kinds of internal settings in the interface.

Most definitely trying to solve a problem. The user that Metabase uses to connect to the database (the one which contains the data that the users will be querying) has a limit of 10 connections and Metabase seems to have a max connection on the pool higher than 10. So regularly, it tries to create a new connection (instead of reusing existing ones) and the user gets an error.

I understand it’s not exposed yet… that’s a bummer! What is the current max connections for the pool set at right now?

Related issues in GitHub 1702 2038

Specific issue for this feature request.

It defaults to 15 according to this:

Is there much more to be discussed other than this really should be configurable through an environment variable or an a per database setting?

I just ran into multiple issues regarding this and exhausting the available connections to the Metabase metadata database.

This hinders scaling Metabase in a controlled manner, as every instance will try to grab 15 connections eventually.

Having this configurable would make the whole setup somewhat more manageable.