Skip to content

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

chore: reduce default batch size of background migrations (#5838)

Steffen Schmitz271f75aa17b9
diff --git a/worker/src/backgroundMigrations/addGenerationsCostBackfill.ts b/worker/src/backgroundMigrations/addGenerationsCostBackfill.ts
index a119aa697c..180c277f91 100644
--- a/worker/src/backgroundMigrations/addGenerationsCostBackfill.ts
+++ b/worker/src/backgroundMigrations/addGenerationsCostBackfill.ts
@@ -66,7 +66,7 @@ export default class AddGenerationsCostBackfill
let previousTimeout;
const maxRowsToProcess = Number(args.maxRowsToProcess ?? Infinity);
- const batchSize = Number(args.batchSize ?? 5000);
+ const batchSize = Number(args.batchSize ?? 1000);
let currentDateCutoff = args.maxDate ?? new Date().toISOString();
try {
@@ -208,7 +208,7 @@ export default class AddGenerationsCostBackfill
async function main() {
const args = parseArgs({
options: {
- batchSize: { type: "string", short: "b", default: "5000" },
+ batchSize: { type: "string", short: "b", default: "1000" },
maxRowsToProcess: { type: "string", short: "r", default: "Infinity" },
maxDate: {
type: "string",
diff --git a/worker/src/backgroundMigrations/migrateObservationsFromPostgresToClickhouse.ts b/worker/src/backgroundMigrations/migrateObservationsFromPostgresToClickhouse.ts
index 4506a57688..d14a90082d 100644
--- a/worker/src/backgroundMigrations/migrateObservationsFromPostgresToClickhouse.ts
+++ b/worker/src/backgroundMigrations/migrateObservationsFromPostgresToClickhouse.ts
@@ -104,7 +104,7 @@ export default class MigrateObservationsFromPostgresToClickhouse
const stateSuffix = (args.stateSuffix as string) ?? "";
const initialDate = await this.getMaxDate(stateSuffix);
const maxRowsToProcess = Number(args.maxRowsToProcess ?? Infinity);
- const batchSize = Number(args.batchSize ?? 5000);
+ const batchSize = Number(args.batchSize ?? 1000);
const maxDate =
initialDate ?? new Date((args.maxDate as string) ?? new Date());
@@ -190,7 +190,7 @@ export default class MigrateObservationsFromPostgresToClickhouse
async function main() {
const args = parseArgs({
options: {
- batchSize: { type: "string", short: "b", default: "5000" },
+ batchSize: { type: "string", short: "b", default: "1000" },
maxRowsToProcess: { type: "string", short: "r", default: "Infinity" },
maxDate: {
type: "string",
diff --git a/worker/src/backgroundMigrations/migrateScoresFromPostgresToClickhouse.ts b/worker/src/backgroundMigrations/migrateScoresFromPostgresToClickhouse.ts
index a83d131a69..01a19911d0 100644
--- a/worker/src/backgroundMigrations/migrateScoresFromPostgresToClickhouse.ts
+++ b/worker/src/backgroundMigrations/migrateScoresFromPostgresToClickhouse.ts
@@ -74,7 +74,7 @@ export default class MigrateScoresFromPostgresToClickhouse
});
const maxRowsToProcess = Number(args.maxRowsToProcess ?? Infinity);
- const batchSize = Number(args.batchSize ?? 5000);
+ const batchSize = Number(args.batchSize ?? 1000);
const maxDate = initialMigrationState.state?.maxDate
? new Date(initialMigrationState.state.maxDate)
: new Date((args.maxDate as string) ?? new Date());
@@ -169,7 +169,7 @@ export default class MigrateScoresFromPostgresToClickhouse
async function main() {
const args = parseArgs({
options: {
- batchSize: { type: "string", short: "b", default: "5000" },
+ batchSize: { type: "string", short: "b", default: "1000" },
maxRowsToProcess: { type: "string", short: "r", default: "Infinity" },
maxDate: {
type: "string",
diff --git a/worker/src/backgroundMigrations/migrateTracesFromPostgresToClickhouse.ts b/worker/src/backgroundMigrations/migrateTracesFromPostgresToClickhouse.ts
index a25dca9c91..69e798a5b3 100644
--- a/worker/src/backgroundMigrations/migrateTracesFromPostgresToClickhouse.ts
+++ b/worker/src/backgroundMigrations/migrateTracesFromPostgresToClickhouse.ts
@@ -74,7 +74,7 @@ export default class MigrateTracesFromPostgresToClickhouse
});
const maxRowsToProcess = Number(args.maxRowsToProcess ?? Infinity);
- const batchSize = Number(args.batchSize ?? 5000);
+ const batchSize = Number(args.batchSize ?? 1000);
const maxDate = initialMigrationState.state?.maxDate
? new Date(initialMigrationState.state.maxDate)
: new Date((args.maxDate as string) ?? new Date());
@@ -169,7 +169,7 @@ export default class MigrateTracesFromPostgresToClickhouse
async function main() {
const args = parseArgs({
options: {
- batchSize: { type: "string", short: "b", default: "5000" },
+ batchSize: { type: "string", short: "b", default: "1000" },
maxRowsToProcess: { type: "string", short: "r", default: "Infinity" },
maxDate: {
type: "string",