Skip to content

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

perf: make batch export part size configurable and reduce default to 10MiB (#11185)

Steffen Schmitz7c64cb03c99b
diff --git a/worker/src/env.ts b/worker/src/env.ts
index 4adb3bb571..ecd8d6c85e 100644
--- a/worker/src/env.ts
+++ b/worker/src/env.ts
@@ -58,6 +58,7 @@ const EnvSchema = z.object({
.number()
.positive()
.default(24),
+ BATCH_EXPORT_S3_PART_SIZE_MIB: z.coerce.number().min(5).max(100).default(10),
BATCH_ACTION_EXPORT_ROW_LIMIT: z.coerce.number().positive().default(50_000),
LANGFUSE_MAX_HISTORIC_EVAL_CREATION_LIMIT: z.coerce
.number()
diff --git a/worker/src/features/batchExport/handleBatchExportJob.ts b/worker/src/features/batchExport/handleBatchExportJob.ts
index 93ad2cff8c..45e47e1dfa 100644
--- a/worker/src/features/batchExport/handleBatchExportJob.ts
+++ b/worker/src/features/batchExport/handleBatchExportJob.ts
@@ -206,7 +206,7 @@ export const handleBatchExportJob = async (
exportOptions[jobDetails.format as BatchExportFileFormat].fileType,
data: fileStream,
expiresInSeconds,
- partSize: 100 * 1024 * 1024, // 100 MB for CSV
+ partSize: env.BATCH_EXPORT_S3_PART_SIZE_MIB * 1024 * 1024,
queueSize: 4,
});