Increase default dbcache size #238

Merged
bvbfan merged 1 commit from increase_dbcache_size into master 2018-11-29 10:27:33 +01:00
bvbfan commented 2018-11-23 13:42:33 +01:00 (Migrated from github.com)

Signed-off-by: Anthony Fieroni bvbfan@abv.bg

Signed-off-by: Anthony Fieroni <bvbfan@abv.bg>
kaykurokawa (Migrated from github.com) reviewed 2018-11-23 13:42:33 +01:00
BrannonKing (Migrated from github.com) reviewed 2018-11-23 14:11:46 +01:00
BrannonKing (Migrated from github.com) commented 2018-11-23 14:06:21 +01:00

Why not throw here as well? and make the method void return?

Why not throw here as well? and make the method void return?
BrannonKing (Migrated from github.com) commented 2018-11-23 14:11:33 +01:00

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 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.
BrannonKing (Migrated from github.com) commented 2018-11-23 14:07:33 +01:00

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.

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.
bvbfan (Migrated from github.com) reviewed 2018-11-23 14:21:29 +01:00
bvbfan (Migrated from github.com) commented 2018-11-23 14:21:29 +01:00

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.

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.
bvbfan (Migrated from github.com) reviewed 2018-11-23 14:21:58 +01:00
bvbfan (Migrated from github.com) commented 2018-11-23 14:21:58 +01:00

So 450 or 500 as Kay suggest?

So 450 or 500 as Kay suggest?
bvbfan (Migrated from github.com) reviewed 2018-11-23 14:23:38 +01:00
bvbfan (Migrated from github.com) commented 2018-11-23 14:23:38 +01:00

Ok.

Ok.
BrannonKing (Migrated from github.com) reviewed 2018-11-23 14:58:26 +01:00
BrannonKing (Migrated from github.com) commented 2018-11-23 14:58:26 +01:00

What about sizeof(void*) >= 8 ? 700 : 400.

What about `sizeof(void*) >= 8 ? 700 : 400`.
BrannonKing (Migrated from github.com) reviewed 2018-11-23 14:59:22 +01:00
BrannonKing (Migrated from github.com) commented 2018-11-23 14:59:22 +01:00

We don't know that 100 blocks back will fail. It's dependent upon the number of TXOs in each block.

We don't know that 100 blocks back will fail. It's dependent upon the number of TXOs in each block.
bvbfan (Migrated from github.com) reviewed 2018-11-23 15:00:12 +01:00
bvbfan (Migrated from github.com) commented 2018-11-23 15:00:12 +01:00

That's good.

That's good.
bvbfan (Migrated from github.com) reviewed 2018-11-23 15:18:57 +01:00
bvbfan (Migrated from github.com) commented 2018-11-23 15:18:57 +01:00

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 ?

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 ?
bvbfan (Migrated from github.com) reviewed 2018-11-23 15:42:15 +01:00
bvbfan (Migrated from github.com) commented 2018-11-23 15:42:15 +01:00

Looks like state is totally unused in DisconnectBlock i'll remove that check entirely.

Looks like state is totally unused in DisconnectBlock i'll remove that check entirely.
kaykurokawa (Migrated from github.com) reviewed 2018-11-25 22:57:38 +01:00
kaykurokawa (Migrated from github.com) commented 2018-11-25 22:57:38 +01:00

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.

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.
bvbfan commented 2018-11-26 08:53:06 +01:00 (Migrated from github.com)

Give it try to another approach.

Give it try to another approach.
BrannonKing (Migrated from github.com) reviewed 2018-11-28 09:26:46 +01:00
BrannonKing (Migrated from github.com) commented 2018-11-28 09:26:46 +01:00

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.

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.
bvbfan (Migrated from github.com) reviewed 2018-11-28 09:32:39 +01:00
bvbfan (Migrated from github.com) commented 2018-11-28 09:32:39 +01:00

On empty block we can fallback to @kaykurokawa suggest

think the previous max of 50 is fine, or we could divide nCoinCacheUsage by 20 mb

What you think?

On empty block we can fallback to @kaykurokawa suggest > think the previous max of 50 is fine, or we could divide nCoinCacheUsage by 20 mb What you think?
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: LBRYCommunity/lbrycrd#238
No description provided.