blocks/blockstore: add CacheOpts - structure of cache config
License: MIT Signed-off-by: Jakub Sztandera <kubuxu@protonmail.ch>
Jakub Sztandera committed
Jul 4, 2016 at 20:08 UTC
3035aa893543a0c1b72d3bc17f2d9c251544537f
1 file changed
+16
blocks/blockstore/caching.go
new
+16
@@ -0,0 +1,16 @@
1
+package blockstore
2
+
3
+// Next to each option is it aproximate memory usage per unit
4
+type CacheOpts struct {
5
+ HasBloomFilterSize int // 1 bit
6
+ HasBloomFilterHashes int // No size, 7 is usually best, consult bloom papers
7
+ HasARCCacheSize int // 32 bytes
8
+}
9
+
10
+func DefaultCacheOpts() CacheOpts {
11
+ return CacheOpts{
12
+ HasBloomFilterSize: 512 * 8 * 1024,
13
+ HasBloomFilterHashes: 7,
14
+ HasARCCacheSize: 64 * 1024,
15
+ }
16
+}