Skip to content

Increased database connections in sequelize 5 #10902

@deppy

Description

@deppy

We upgraded from Sequelize 4.x to 5.x recently and have noticed that we are seeing many more connections to our database since the upgrade. In the graph below you can see that the number of connections (red line) has gone up dramatically since the upgrade on 13 April while the number of servers (green line) has not changed much at all. I see that pooling changed in v5 but it seems that our config should still be valid and that nothing should have changed the number of connections we're seeing. Wondering if anyone else is seeing this because it wasn't an expected behavior.

Screen Shot 2019-05-03 at 10 19 59

What are you doing?

  pool: {
    max: parseInt(config.database.pool.max), //Set to 40
    min: parseInt(config.database.pool.min), //Set to 2
    idle: 2 * 60 * 1000,
    acquire: 15 * 1000
  },

To Reproduce
Steps to reproduce the behavior:

  1. Use the same config on sequelize 4.x and 5.x
  2. Generate a bunch of requests and/or async tasks that require the database
  3. Compare the number of open database connections

What do you expect to happen?

I would expect the pool to use roughly the same number of database connections

What is actually happening?

The number of database connections goes up by roughly 2.5x

Environment

Dialect:

  • postgres
    Dialect library version: 7.10.0 (pg)
    Database version: 10.6
    Sequelize version: 5.6.0
    Node Version: 11.12.0
    OS: Ubuntu 16.04

Metadata

Metadata

Assignees

Labels

dependencyFor issues and PRs. Things that are related to one or more dependencies.releasedtype: bugDEPRECATED: replace with the "bug" issue type

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions