From 0ecfd7843cbc5315193bc9e2dec9c69dc246006a Mon Sep 17 00:00:00 2001 From: Dominic Della Valle Date: Fri, 6 Apr 2018 15:56:19 -0400 Subject: [PATCH 1/2] Add information about bloom filter to config.md License: MIT Signed-off-by: Dominic Della Valle --- docs/config.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/docs/config.md b/docs/config.md index e89a8fc9f..211f69a12 100644 --- a/docs/config.md +++ b/docs/config.md @@ -141,8 +141,13 @@ A boolean value. If set to true, all block reads from disk will be hashed and verified. This will cause increased CPU utilization. - `BloomFilterSize` -A number representing the size in bytes of the blockstore's bloom filter. A -value of zero represents the feature being disabled. +A number representing the size in bytes of the blockstore's [bloom filter](https://en.wikipedia.org/wiki/Bloom_filter). A value of zero represents the feature being disabled. + +This site generates useful graphs for various bloom filter values: +You may use it to find a preferred optimal value, where `m` is `BloomFilterSize` in bits. Remember to convert the value `m` from bits, into bytes for use as `BloomFilterSize` in the config file. +For example, for 1,000,000 blocks, expecting a 1% false positive rate, you'd end up with a filter size of 9592955 bits, so for `BloomFilterSize` we'd want to use 1199120 bytes. +[Currently](https://github.com/ipfs/go-ipfs/blob/9c194aa7e2febeab0cbd895067d7d90d82b137f9/blocks/blockstore/caching.go), 7 hash functions are used by default, so the constant `k` is 7 in the formula. + Default: `0` From c3e3da4a5417042414496cd9c576764812eac1de Mon Sep 17 00:00:00 2001 From: Dominic Della Valle Date: Mon, 9 Apr 2018 15:45:45 -0400 Subject: [PATCH 2/2] Revised License: MIT Signed-off-by: Dominic Della Valle --- docs/config.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/config.md b/docs/config.md index 211f69a12..f33420c15 100644 --- a/docs/config.md +++ b/docs/config.md @@ -146,7 +146,7 @@ A number representing the size in bytes of the blockstore's [bloom filter](https This site generates useful graphs for various bloom filter values: You may use it to find a preferred optimal value, where `m` is `BloomFilterSize` in bits. Remember to convert the value `m` from bits, into bytes for use as `BloomFilterSize` in the config file. For example, for 1,000,000 blocks, expecting a 1% false positive rate, you'd end up with a filter size of 9592955 bits, so for `BloomFilterSize` we'd want to use 1199120 bytes. -[Currently](https://github.com/ipfs/go-ipfs/blob/9c194aa7e2febeab0cbd895067d7d90d82b137f9/blocks/blockstore/caching.go), 7 hash functions are used by default, so the constant `k` is 7 in the formula. +As of writing, [7 hash functions](https://github.com/ipfs/go-ipfs-blockstore/blob/547442836ade055cc114b562a3cc193d4e57c884/caching.go#L22) are used, so the constant `k` is 7 in the formula. Default: `0`