Skip to content

Commit

Permalink
feat(core): Make postgres pool-size configurable (no-changelog) (#7772)
Browse files Browse the repository at this point in the history
When we upgrade typeorm in #5151, we switched from no pooling to a
default pool-size of 10. This somehow significantly deteriorates the
performance of queries when the application is under load.
  • Loading branch information
netroy authored Nov 21, 2023
1 parent 3459eb6 commit 9b4856e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions packages/cli/src/config/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,12 @@ export const schema = {
default: 'public',
env: 'DB_POSTGRESDB_SCHEMA',
},
poolSize: {
doc: 'PostgresDB Pool Size',
format: Number,
default: 2,
env: 'DB_POSTGRESDB_POOL_SIZE',
},

ssl: {
enabled: {
Expand Down
1 change: 1 addition & 0 deletions packages/cli/src/databases/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ export const getPostgresConnectionOptions = (): PostgresConnectionOptions => ({
type: 'postgres',
...getDBConnectionOptions('postgresdb'),
schema: config.getEnv('database.postgresdb.schema'),
poolSize: config.getEnv('database.postgresdb.poolSize'),
migrations: postgresMigrations,
});

Expand Down

0 comments on commit 9b4856e

Please sign in to comment.