Is a persistent db connection required?

Hello,

Two things of here to note:

  • AWS Aurora actually is not in our list of supported databases, Aurora is listed as compatible with PG and MySQL but does not run the same codebase and we do not actively test it’s usage.

  • Database connections are managed by Knex (specifically the tarn pooling provided by Knex) and you can customize the timeouts and min/max connections via the database.js. See the Bookshelf configuration on our documentation

The key points of that documentation are the options.pool object

  • Min => Keeps x amount of connection alive at all times (default is 1)
  • Max => Maximum number of connections allowed in the pool
  • idleTimeoutMillis => Wait time before destroying idle connections in the pool
  • reapIntervalMillis => How often to check for idle connections

In your case I believe it’s likely the min pool option as the default of 1 causing the issue, however you are running an “at your own risk” type of setup by using Aurora. Any bugs found while using that database that cannot be replicated into a supported version of PostgreSQL, MySQL, or MariaDB we cannot help you with.

2 Likes