Skip to content

Commit

Permalink
Performance tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
AlCutter committed Aug 1, 2024
1 parent b14d898 commit fa1e5b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
1 change: 1 addition & 0 deletions cmd/example-gcp/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ func main() {
storage, err := gcp.New(ctx, gcpCfg,
tessera.WithCheckpointSignerVerifier(signerFromFlags(), nil),
tessera.WithBatching(1024, time.Second),
tessera.WithPushback(10*4096),
)
if err != nil {
klog.Exitf("Failed to create new GCP storage: %v", err)
Expand Down
18 changes: 7 additions & 11 deletions storage/gcp/gcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ const (
entryBundleSize = 256

DefaultPushbackMaxOutstanding = 4096
DefaultIntegrationSizeLimit = 2048
DefaultIntegrationSizeLimit = 5 * 4096
)

// Storage is a GCP based storage implementation for Tessera.
Expand Down Expand Up @@ -145,16 +145,12 @@ func New(ctx context.Context, cfg Config, opts ...func(*tessera.StorageOptions))
return
case <-t.C:
}
for {
cctx, cancel := context.WithTimeout(ctx, 10*time.Second)
defer cancel()
if more, err := r.sequencer.consumeEntries(cctx, DefaultIntegrationSizeLimit, r.integrate); err != nil {
klog.Errorf("integrate: %v", err)
break
} else if !more {
break
}
klog.V(1).Info("Quickloop")
// Don't quicklook for now, it causes issues updating checkpoint too frequently.
cctx, cancel := context.WithTimeout(ctx, 10*time.Second)
defer cancel()
if _, err := r.sequencer.consumeEntries(cctx, DefaultIntegrationSizeLimit, r.integrate); err != nil {
klog.Errorf("integrate: %v", err)
break
}
}
}()
Expand Down

0 comments on commit fa1e5b6

Please sign in to comment.