Increase default dbcache size #238
No reviewers
Labels
No labels
area: devops
area: discovery
area: docs
area: livestream
area: proposal
consider soon
Epic
good first issue
hacktoberfest
hard fork
help wanted
icebox
Invalid
level: 0
level: 1
level: 2
level: 3
level: 4
needs: exploration
needs: grooming
needs: priority
needs: repro
needs: tech design
on hold
priority: blocker
priority: high
priority: low
priority: medium
resilience
soft fork
Tom's Wishlist
type: bug
type: discussion
type: improvement
type: new feature
type: refactor
type: task
type: testing
unplanned
work in progress
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: LBRYCommunity/lbrycrd#238
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "increase_dbcache_size"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Anthony Fieroni bvbfan@abv.bg
Why not throw here as well? and make the method void return?
I like the idea of limiting decrements on RAM. However, I don't think this line accomplishes that. You can't make an assumption that each block uses the same amount of coin cache. I think this check of MAX decrements could probably go away. We just use available memory then give up.
I'm worried about this default on Windows. It's currently running in 32bit and using 1.2GB of RAM. This will bump it up against the 2GB barrier on Windows.
It's relaxing check that deeper block can fail on rollback.
E.g. MAX_RPC_BLOCK_DECREMENTS is 50 but request wants 100 so does not need to call rollback - we know that it'll fail.
So 450 or 500 as Kay suggest?
Ok.
What about
sizeof(void*) >= 8 ? 700 : 400
.We don't know that 100 blocks back will fail. It's dependent upon the number of TXOs in each block.
That's good.
Yep but most likely will fail, i think we need some value that will prevent rollback to take time for nothing. nCoinCacheUsage / currentMemoryUsage * 1.5 or something ?
Looks like state is totally unused in DisconnectBlock i'll remove that check entirely.
I agree with Brannon that this approach
'MAX_RPC_BLOCK_DECREMENTS = nCoinCacheUsage / currentMemoryUsage' is not correct.
because current memory usage is not predictive of what memory usage a roll back will cost.
I'm in favor of keeping MAX_RPC_BLOCK_DECREMENTS to a high constant. I think the previous max of 50 is fine, or we could divide nCoinCacheUsage by 20 mb (in my tests I saw that a 1mb block used about 10 mb of cache, and our max block size is 2mb). This is in case someone accidentally sets a very high roll back, we don't have to waste time or resource trying to roll back, we will know immediately that the roll back is too high.
Give it try to another approach.
I still don't think this approach will work. Too often we will have empty blocks. If you use one of those as a template your numbers here will be meaningless.
On empty block we can fallback to @kaykurokawa suggest
What you think?