Skip to content

🪢 Open source agent evals & observability: Trace, evaluate, and improve LLM applications with one open platform.

chore: increase part size for csv exports (#9916)

Max Deichmannc8fb8ddc1932
diff --git a/packages/shared/src/server/services/StorageService.ts b/packages/shared/src/server/services/StorageService.ts
index e84eb813b1..fb67db4a52 100644
--- a/packages/shared/src/server/services/StorageService.ts
+++ b/packages/shared/src/server/services/StorageService.ts
@@ -25,6 +25,8 @@ type UploadFile = {
fileName: string;
fileType: string;
data: Readable | string;
+ partSize?: number; // Optional: Part size in bytes for multipart uploads (S3 only)
+ queueSize?: number; // Optional: Number of concurrent part uploads (S3 only)
};
type UploadWithSignedUrl = UploadFile & {
@@ -501,6 +503,8 @@ class S3StorageService implements StorageService {
fileName,
fileType,
data,
+ partSize,
+ queueSize,
}: UploadFile): Promise<void> {
try {
await new Upload({
@@ -511,6 +515,11 @@ class S3StorageService implements StorageService {
Body: data,
ContentType: fileType,
}),
+ // Use provided partSize and queueSize, or fall back to defaults
+ // Default: 5 MB part size supports files up to ~50 GB (5 MB × 10,000 parts)
+ // For large files, use partSize: 100 * 1024 * 1024 (100 MB) to support up to ~1 TB
+ partSize: partSize,
+ queueSize: queueSize,
}).done();
return;
@@ -525,9 +534,11 @@ class S3StorageService implements StorageService {
fileType,
data,
expiresInSeconds,
+ partSize,
+ queueSize,
}: UploadWithSignedUrl): Promise<{ signedUrl: string }> {
try {
- await this.uploadFile({ fileName, data, fileType });
+ await this.uploadFile({ fileName, data, fileType, partSize, queueSize });
const signedUrl = await this.getSignedUrl(fileName, expiresInSeconds);
diff --git a/worker/src/features/batchExport/handleBatchExportJob.ts b/worker/src/features/batchExport/handleBatchExportJob.ts
index 1058b68a98..438191c163 100644
--- a/worker/src/features/batchExport/handleBatchExportJob.ts
+++ b/worker/src/features/batchExport/handleBatchExportJob.ts
@@ -198,6 +198,8 @@ export const handleBatchExportJob = async (
exportOptions[jobDetails.format as BatchExportFileFormat].fileType,
data: fileStream,
expiresInSeconds,
+ partSize: 100 * 1024 * 1024, // 100 MB for CSV
+ queueSize: 4,
});
logger.info(`Batch export file ${fileName} uploaded to S3`);
diff --git a/worker/src/features/blobstorage/handleBlobStorageIntegrationProjectJob.ts b/worker/src/features/blobstorage/handleBlobStorageIntegrationProjectJob.ts
index e7c751f1fa..3e806f7966 100644
--- a/worker/src/features/blobstorage/handleBlobStorageIntegrationProjectJob.ts
+++ b/worker/src/features/blobstorage/handleBlobStorageIntegrationProjectJob.ts
@@ -153,10 +153,15 @@ const processBlobStorageExport = async (config: {
);
// Upload the file to cloud storage
+ // For CSV exports, use larger part size to handle big files
+ // 100 MB parts support files up to ~1 TB (100 MB × 10,000 AWS limit)
+ // This prevents hitting AWS's 10,000 part limit on large exports
+
await storageService.uploadFile({
fileName: filePath,
fileType: blobStorageProps.contentType,
data: fileStream,
+ partSize: 100 * 1024 * 1024, // 100 MB part size
});
logger.info(