Skip to content

Commit b281685

Browse files
committed
add flag
1 parent bab4f11 commit b281685

File tree

1 file changed

+3
-2
lines changed
  • cmd/experimental/migrate/gcp

1 file changed

+3
-2
lines changed

cmd/experimental/migrate/gcp/main.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ var (
4141

4242
sourceURL = flag.String("source_url", "", "Base URL for the source log.")
4343
numWorkers = flag.Uint("num_workers", 30, "Number of migration worker goroutines.")
44-
persistentAntispam = flag.Bool("antispam", false, "EXPERIMENTAL: Set to true to enable GCP-based persistent antispam storage")
44+
persistentAntispam = flag.Bool("antispam", false, "EXPERIMENTAL: Set to true to enable GCP-based persistent antispam storage.")
45+
antispamBatchSize = flag.Uint("antispam_batch_size", 1500, "EXPERIMENTAL: maximum number of antispam rows to insert in a batch (1500 gives good performance with 300 Spanner PU and above, smaller values may be required for smaller allocs).")
4546
)
4647

4748
func main() {
@@ -92,7 +93,7 @@ func main() {
9293
// 1500 appears to be give good performance for migrating logs, but you may need to lower it if you have
9394
// less than 300 Spanner PU available. (Consider temporarily raising your Spanner CPU quota to be at least
9495
// this amount for the duration of the migration.)
95-
MaxBatchSize: 1500,
96+
MaxBatchSize: *antispamBatchSize,
9697
}
9798
antispam, err = gcp_as.NewAntispam(ctx, fmt.Sprintf("%s-antispam", *spanner), as_opts)
9899
if err != nil {

0 commit comments

Comments
 (0)