Skip to content

Commit 35b73ec

Browse files
fix: db 설정 최적화
1 parent cfc292c commit 35b73ec

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

app/lib/dbConnect.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,12 @@ async function dbConnect(uri?: string, retries = 3): Promise<Mongoose> {
6666
const opts = {
6767
bufferCommands: false,
6868
maxPoolSize: 10,
69-
minPoolSize: 2,
70-
serverSelectionTimeoutMS: 5000,
71-
socketTimeoutMS: 45000,
72-
connectTimeoutMS: 10000,
69+
minPoolSize: 1,
70+
serverSelectionTimeoutMS: 3000,
71+
socketTimeoutMS: 20000,
72+
connectTimeoutMS: 5000,
73+
maxIdleTimeMS: 30000,
74+
waitQueueTimeoutMS: 5000,
7375
};
7476

7577
cached.promise = mongoose

0 commit comments

Comments
 (0)