Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UBERF-8387 Adjust S3 client parameters #7038

Merged
merged 1 commit into from
Oct 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion common/config/rush/pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion server/s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
"@hcengineering/storage": "^0.6.0",
"@aws-sdk/client-s3": "^3.575.0",
"@aws-sdk/s3-request-presigner": "^3.582.0",
"@aws-sdk/lib-storage": "^3.583.0"
"@aws-sdk/lib-storage": "^3.583.0",
"@smithy/node-http-handler": "^3.0.0"
}
}
11 changes: 10 additions & 1 deletion server/s3/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@

import { CopyObjectCommand, PutObjectCommand, S3 } from '@aws-sdk/client-s3'
import { Upload } from '@aws-sdk/lib-storage'
import { NodeHttpHandler } from '@smithy/node-http-handler'
import { Agent as HttpAgent } from 'http'
import { Agent as HttpsAgent } from 'https'

import core, {
toWorkspaceString,
Expand Down Expand Up @@ -70,7 +73,13 @@ export class S3Service implements StorageAdapter {
accessKeyId: opt.accessKey,
secretAccessKey: opt.secretKey
},
region: opt.region ?? 'auto'
region: opt.region ?? 'auto',
requestHandler: new NodeHttpHandler({
connectionTimeout: 5000,
socketTimeout: 120000,
httpAgent: new HttpAgent({ maxSockets: 500, keepAlive: true }),
httpsAgent: new HttpsAgent({ maxSockets: 500, keepAlive: true })
})
})

this.expireTime = parseInt(this.opt.expireTime ?? '168') * 3600 // use 7 * 24 - hours as default value for expireF
Expand Down