Skip to content
This repository was archived by the owner on Mar 14, 2025. It is now read-only.

Commit 2458bbd

Browse files
0xnogodimkouvstackman27
committed
Increase token data worker settings and cache duration (#1583)
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]>
1 parent 92a45a2 commit 2458bbd

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

core/services/ocr2/plugins/ccip/ccipexec/initializers.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,9 @@ var (
4343
// 5s for token data worker timeout is a reasonable default.
4444
tokenDataWorkerTimeout = 5 * time.Second
4545
// tokenDataWorkerNumWorkers is the number of workers that will be processing token data in parallel.
46-
tokenDataWorkerNumWorkers = 5
46+
tokenDataWorkerNumWorkers = 10
47+
// expirationDur is the duration for which the token data will be cached.
48+
expirationDurTokenData = 10 * time.Minute
4749
)
4850

4951
var defaultNewReportingPluginRetryConfig = ccipdata.RetryConfig{
@@ -169,7 +171,7 @@ func NewExecServices(ctx context.Context, lggr logger.Logger, jb job.Job, srcPro
169171
tokenDataProviders,
170172
tokenDataWorkerNumWorkers,
171173
tokenDataWorkerTimeout,
172-
2*tokenDataWorkerTimeout,
174+
expirationDurTokenData,
173175
)
174176

175177
wrappedPluginFactory := NewExecutionReportingPluginFactory(ExecutionPluginStaticConfig{

core/services/ocr2/plugins/ccip/tokendata/bgworker.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ func NewBackgroundWorker(
6060
return &BackgroundWorker{
6161
tokenDataReaders: tokenDataReaders,
6262
numWorkers: numWorkers,
63-
jobsChan: make(chan cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, numWorkers*100),
63+
jobsChan: make(chan cciptypes.EVM2EVMOnRampCCIPSendRequestedWithMeta, numWorkers*200),
6464
resultsCache: cache.New(expirationDur, expirationDur/2),
6565
timeoutDur: timeoutDur,
6666

0 commit comments

Comments
 (0)