increase connection pool

This commit is contained in:
2026-06-04 15:21:51 +03:30
parent 17869470ab
commit 70711de81c
4 changed files with 7 additions and 17 deletions
+1
View File
@@ -61,6 +61,7 @@ export default defineConfig({
emit: 'ts',
},
connect: true,
// CLI-only (migrations/seeders run outside HTTP); runtime app config must not set this.
allowGlobalContext: true,
seeder: {
path: './dist/seeders',
+4 -13
View File
@@ -8,16 +8,7 @@ import { MIKRO_ORM_QUERY_LOGGER } from '../common/constants';
import { mikroOrmQueryLoggerProvider } from '../common/providers/mikro-orm-logger.provider';
const dataBaseConfig: MikroOrmModuleAsyncOptions = {
// entities: ['dist/**/*.entity.js'],
// entitiesTs: ['src/**/*.entity.ts'],
// dbName: 'your_db_name',
// type: 'postgresql',
// user: 'your_user',
// password: 'your_password',
// host: 'localhost',
// port: 5432,
// debug: true,
inject: [ConfigService, MIKRO_ORM_QUERY_LOGGER],
providers: [mikroOrmQueryLoggerProvider],
useFactory: (configService: ConfigService, logger: Logger) => {
@@ -46,8 +37,8 @@ const dataBaseConfig: MikroOrmModuleAsyncOptions = {
},
forceUtcTimezone: true,
pool: {
min: isProduction ? 5 : 2,
max: isProduction ? 20 : 10,
min: isProduction ? 30 : 5,
max: isProduction ? 100 : 50,
idleTimeoutMillis: 30000,
acquireTimeoutMillis: 30000,
reapIntervalMillis: 1000,
@@ -71,7 +62,7 @@ const dataBaseConfig: MikroOrmModuleAsyncOptions = {
emit: 'ts',
},
connect: true,
allowGlobalContext: true,
registerRequestContext: true,
driverOptions: {
connection: {
keepAlive: true,