Skip to content

Commit

Permalink
Increase token data worker settings and cache duration (#1583)
Browse files Browse the repository at this point in the history
Adjust the number of token data workers and increase the cache duration
for token data to improve performance and efficiency.

Co-authored-by: dimitris <[email protected]>
Co-authored-by: Sishir Giri <[email protected]>
  • Loading branch information
3 people authored Jan 8, 2025
1 parent 9e91b40 commit d323f98
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions core/services/ocr2/plugins/ccip/ccipexec/initializers.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ var (
// 5s for token data worker timeout is a reasonable default.
tokenDataWorkerTimeout = 5 * time.Second
// tokenDataWorkerNumWorkers is the number of workers that will be processing token data in parallel.
tokenDataWorkerNumWorkers = 5
tokenDataWorkerNumWorkers = 10
// expirationDur is the duration for which the token data will be cached.
expirationDurTokenData = 10 * time.Minute
)

var defaultNewReportingPluginRetryConfig = ccipdata.RetryConfig{
Expand Down Expand Up @@ -169,7 +171,7 @@ func NewExecServices(ctx context.Context, lggr logger.Logger, jb job.Job, srcPro
tokenDataProviders,
tokenDataWorkerNumWorkers,
tokenDataWorkerTimeout,
2*tokenDataWorkerTimeout,
expirationDurTokenData,
)

wrappedPluginFactory := NewExecutionReportingPluginFactory(ExecutionPluginStaticConfig{
Expand Down
2 changes: 1 addition & 1 deletion core/services/ocr2/plugins/ccip/tokendata/bgworker.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func NewBackgroundWorker(
return &BackgroundWorker{
tokenDataReaders: tokenDataReaders,
numWorkers: numWorkers,
jobsChan: make(chan cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, numWorkers*100),
jobsChan: make(chan cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, numWorkers*200),
resultsCache: cache.New(expirationDur, expirationDur/2),
timeoutDur: timeoutDur,

Expand Down

0 comments on commit d323f98

Please sign in to comment.