Skip to content

Commit 8224f89

Browse files
authored
params(store): Change default cache size for StoreCache + WriteBatch (#252)
Reduce defaults to be more sane.
1 parent 12cc054 commit 8224f89

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

interface.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
const (
1111
// MaxRangeRequestSize defines the max amount of headers that can be handled/requested at once.
12-
MaxRangeRequestSize uint64 = 512
12+
MaxRangeRequestSize uint64 = 64
1313
)
1414

1515
// Subscriber encompasses the behavior necessary to

p2p/server_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ func TestExchangeServer_Timeout(t *testing.T) {
9393
ctx, cancel := context.WithTimeout(context.Background(), testRequestTimeout)
9494
defer cancel()
9595

96-
_, err := server.handleRangeRequest(ctx, 1, 100)
96+
_, err := server.handleRangeRequest(ctx, 1, header.MaxRangeRequestSize)
9797
return err
9898
},
9999
},

store/options.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ type Parameters struct {
3333
// DefaultParameters returns the default params to configure the store.
3434
func DefaultParameters() Parameters {
3535
return Parameters{
36-
StoreCacheSize: 4096,
37-
IndexCacheSize: 16384,
38-
WriteBatchSize: 2048,
36+
StoreCacheSize: 512,
37+
IndexCacheSize: 2048,
38+
WriteBatchSize: 64,
3939
}
4040
}
4141

0 commit comments

Comments
 (0)