-
Notifications
You must be signed in to change notification settings - Fork 215
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sql: add an option to cache query results (#5465)
With `{"main":{db-query-cache": true}}` option (false by default), some of the query results are stored in memory. ## Motivation On the nodes with high peer counts, a lot of CPU time is spent on handling SQLite queries and also GC resulting from multiple database requests and same data being serialized over and over again. With the query cache enabled on such nodes, the memory use doesn't increase much, as normally there's large number of requests "in flight" most of the time, and cached data are reused to handle these requests w/o further temporary allocations. ## Changes Currently, ATX ID lists per epoch, ATX blobs and ActiveSet blobs are cached. Also, serialized ATX ID lists are cached by the fetcher. This reduces CPU load and GC pressure on the nodes that serve a lot of fetch requests. ## Test Plan Verified on a node with 8K+ peers
- Loading branch information
Showing
16 changed files
with
928 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.