Skip to content

Commit

Permalink
chore: update default mongodb connection settings
Browse files Browse the repository at this point in the history
  • Loading branch information
dolcalmi committed Nov 5, 2024
1 parent f524b20 commit 35538dc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/api/src/servers/exporter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ const main = async () => {

setupMongoConnection({
syncIndexes: false,
options: { readPreference: "secondaryPreferred" },
options: { readPreference: "secondaryPreferred", socketTimeoutMS: 120000 },
})
.then(() => main())
.catch((err) => logger.error(err))
Expand Down
6 changes: 3 additions & 3 deletions core/api/src/services/mongodb/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ const DEFAULT_MONGODB_OPTIONS: mongoose.ConnectOptions = {
compressors: ["snappy", "zlib"],

maxPoolSize: 100,
minPoolSize: 20,
maxConnecting: 25, // Maximum number of concurrent connection attempts
minPoolSize: 15,
maxConnecting: 5, // Maximum number of concurrent connection attempts

socketTimeoutMS: 45000, // Close sockets after 45 seconds of inactivity
socketTimeoutMS: 60000, // Close sockets after 60 seconds of inactivity
connectTimeoutMS: 15000, // Give up initial connection after 15 seconds
serverSelectionTimeoutMS: 15000, // Keep trying to send operations for 15 seconds

Expand Down

0 comments on commit 35538dc

Please sign in to comment.