This repository was archived by the owner on Jul 19, 2024. It is now read-only.
Open
Conversation
chunkSize too small(10). Scan all block take n*M times. - M is average time to hit to leveldb - n = highestBlock / chunkSize Reduce n to help reduce response time
|
I just noticed this pull requests and applied the suggested fix to the indexd instances on my servers and it seems to be running MUCH faster. Thank you very much @longhoangwkm for submitting this fix. |
Author
|
You're welcome. Btw, we sometimes have problems with exceeding the max limit for the number of node object errors. I think we should keep developing this CIP: https://counterpartytalk.org/t/cip22-change-indexd-to-addrindexrs/5870. We need a big change, I'm eager to contribute to a new project. |
This file contains hidden or 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
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem:
curl -XGET localhost:8432/a/1AuGvfDfNhbeVNUDzXHjLmEnFnWv3pkjjG/utxosResponse time: ~60 seconds or time out.
Debug:
To get utxos, we searchRange all blocks by addressToScriptID:
If latest block is ~1M6. Split all blocks to n time to hit db by chunkSize.
Example, latest block is ~1M6. / chunkSize(10) = 160k times.
i found that chunkSize too small, hit to leveldb too much.
Reduce n to help reduce response time
Solution:
I tried to increase chunkSize value to 100, 1000, 10_000 and 100_000.
Benchmark show that with chunkSize = 10_000 return good response Time
< 1 seconds on mainnet