You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor the current account processing implementation to be single-threaded and sequential, reducing unnecessary load on the database by removing aggressive polling of the database.
Problem Definition
The current implementation spawns 5 coroutines that continuously poll the ProcessQueueRecord table, resulting in up to 330 requests per second to that table. This seems too aggressive for what it is is doing.
Once this is released, we need to confirm that the single threaded solution is enough and can keep up.
Proposal
Current code that starts 5 coroutine while loops that never end:
It seems like this code is approaching the accounts wrong... instead of starting with the large number of accounts and looking for changes ... why does it not focus on the small number of changes and apply them to the impacted accounts?
I think it is trying to update accounts when they do change. For every transaction it tries to extract all account addresses associated with it. Adds them to a processing queue and has another thread process them.
Summary
Refactor the current account processing implementation to be single-threaded and sequential, reducing unnecessary load on the database by removing aggressive polling of the database.
Problem Definition
The current implementation spawns 5 coroutines that continuously poll the
ProcessQueueRecord
table, resulting in up to 330 requests per second to that table. This seems too aggressive for what it is is doing.Once this is released, we need to confirm that the single threaded solution is enough and can keep up.
Proposal
Current code that starts 5 coroutine while loops that never end:
explorer-service/service/src/main/kotlin/io/provenance/explorer/service/async/ScheduledTaskService.kt
Line 471 in 671b1a0
New impl:
For Admin Use
The text was updated successfully, but these errors were encountered: