Hi DAML team, we are using the DAML sandbox with a postgresql database. Currently we see that there are 81 connections (most of them idle) to the database. How is the connection pool configured on the DAML sandbox? Thanks for your support.
At the moment, the connection pools used by DAML Sandbox cannot be configured. The DAML Sandbox consist of different components internally that access the database, with generously configured default values for connection pool sizes.
Thanks for the answer. Can you tell me which are the default values.
Currently, we establish:
- 16 connections for the ledger API server component
- 16 connections for the indexer component
- an unbounded number of connections for the ledger itself
There may be a couple more, but this is probably most of them.
These numbers haven’t been tuned much beyond “this works”. Are you experiencing any problems due to the number of connections?
thanks for your answer. I am working together with @DavidBelinchon and we are connecting the DAML sandbox to a AWS RDS PostgreSQL instance. The sandbox opens between 70 and 80 connections to the database leaving few connections for other services. Do you suggest to have a dedicated database server instance for the DAML sandbox?
Sandbox assumes it’s the only process using the PostgreSQL server. That said, the number of connections does sound aggressive and we may want to find a way to cap that at some point.
If you’re planning on running DAML in production on AWS, you might find DAML on PostgreSQL interesting. I believe the website is coming soon. @bernhard might be able to help you out with that.
Indeed, for production use, I would not use Sandbox, which is a developer tool and has no data continuity guarantees, but DAML for Postgres. A free and open source version is published on GitHub Releases.
Thanks @bernhard, will have a look at it.
As a side-note, as of today you should see a similar behavior on DAML for PostgreSQL, but limited to fixed-size connection pools that should amount to 48 connections. Depending on your situation you may want to evaluate having a dedicated database for DAML, considering that multi-tenancy also has performance implications, especially if you are running concurrently with other applications that may keep the database busy.